Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungThe Indie Dev Visibility Playbook: From Zero Users to Your First 100(21.09.2026 um 00:08 Uhr)
Sichere ProgrammierungBase, Chat and Reasoning Models: How Are They Different?(21.09.2026 um 00:09 Uhr)
Sichere ProgrammierungHexfield Deck is for Kanban lovers and Markdown believers(21.09.2026 um 00:20 Uhr)
Sichere ProgrammierungPermissions and Authorisation: A Practical Playbook(21.09.2026 um 00:21 Uhr)
Linux Tipps & Hardeningfilet | Terminal File Manager(20.09.2026 um 21:03 Uhr)
Linux Tipps & HardeningLooking for feedback on my Linux Distro(20.09.2026 um 21:03 Uhr)
Sichere ProgrammierungThe Indie Dev Visibility Playbook: From Zero Users to Your First 100(21.09.2026 um 00:08 Uhr)
Sichere ProgrammierungBase, Chat and Reasoning Models: How Are They Different?(21.09.2026 um 00:09 Uhr)
Sichere ProgrammierungHexfield Deck is for Kanban lovers and Markdown believers(21.09.2026 um 00:20 Uhr)
Sichere ProgrammierungPermissions and Authorisation: A Practical Playbook(21.09.2026 um 00:21 Uhr)
Linux Tipps & Hardeningfilet | Terminal File Manager(20.09.2026 um 21:03 Uhr)
Linux Tipps & HardeningLooking for feedback on my Linux Distro(20.09.2026 um 21:03 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Adaptation Rules from TypeScript to ArkTS (4)

Reagiere als Erste:r — dein Feedback zählt!

ArkTS Constraints on TypeScript Features

No Support for Conditional Types

  • Rule: arkts-no-conditional-types
  • Severity: Error

    • Description: ArkTS does not support conditional type aliases. Introduce new types with explicit constraints or rewrite logic using Object.
    • TypeScript Example:
type X<T> = T extends number ? T : never;
type Y<T> = T extends Array<infer Item> ? Item : never;
  • ArkTS Example:
// Provide explicit constraints in type aliases
type X1<T extends number> = T;

// Rewrite with Object, with less type control and a need for more type checks
type X2<T> = Object;

// Item must be used as a generic parameter and correctly instantiable
type YI<Item, T extends Array<Item>> = Item;

No Support for Field Declarations in Constructors

  • Rule: arkts-no-ctor-prop-decls
  • Severity: Error

    • Description: ArkTS does not support declaring class fields within constructors. Declare these fields within the class.
    • TypeScript Example:
class Person {
  constructor(
    protected ssn: string,
    private firstName: string,
    private lastName: string
  ) {
    this.ssn = ssn;
    this.firstName = firstName;
    this.lastName = lastName;
  }

  getFullName(): string {
    return this.firstName + ' ' + this.lastName;
  }
}
  • ArkTS Example:
class Person {
  protected ssn: string;
  private firstName: string;
  private lastName: string;

  constructor(ssn: string, firstName: string, lastName: string) {
    this.ssn = ssn;
    this.firstName = firstName;
    this.lastName = lastName;
  }

  getFullName(): string {
    return this.firstName + ' ' + this.lastName;
  }
}

No Support for Constructor Signatures in Interfaces

  • Rule: arkts-no-ctor-signatures-iface
  • Severity: Error

    • Description: ArkTS does not support constructor signatures in interfaces. Use functions or methods instead.
    • TypeScript Example:
interface I {
  new (s: string): I;
}

function fn(i: I) {
  return new i('hello');
}
  • ArkTS Example:
interface I {
  create(s: string): I;
}

function fn(i: I) {
  return i.create('hello');
}

No Support for Index Access Types

  • Rule: arkts-no-aliases-by-index
  • Severity: Error

    • Description: ArkTS does not support index access types.

No Support for Field Access by Index

  • Rule: arkts-no-props-by-index
  • Severity: Error

    • Description: ArkTS does not support dynamic field declaration or access. You can only access fields declared in the class or inherited visible fields. Accessing other fields will result in a compile - time error.
    • TypeScript Example:
class Point {
  x: string = '';
  y: string = '';
}
let p: Point = { x: '1', y: '2' };
console.log(p['x']);

class Person {
  name: string = '';
  age: number = 0;
  [key: string]: string | number;
}

let person: Person = {
  name: 'John',
  age: 30,
  email: '***@example.com',
  phoneNumber: '18*********',
};
  • ArkTS Example:
class Point {
  x: string = '';
  y: string = '';
}
let p: Point = { x: '1', y: '2' };
console.log(p.x);

class Person {
  name: string;
  age: number;
  email: string;
  phoneNumber: string;

  constructor(name: string, age: number, email: string, phoneNumber: string) {
    this.name = name;
    this.age = age;
    this.email = email;
    this.phoneNumber = phoneNumber;
  }
}

let person = new Person('John', 30, '***@example.com', '18*********');
console.log(person['name']); // Compile - time error
console.log(person.unknownProperty); // Compile - time error

let arr = new Int32Array(1);
arr[0];
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Adaptation Rules from TypeScript to ArkTS (4)

Thematisch verwandte Begriffe: Adaptation, Rules, from, TypeScript · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-94084 | Suricata before 8.0.7 has an Http2ThreadMultiBuf use-after-free when a t…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick