@vicin/sigil 1.2.6 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.3.0] - 2026-02-18
6
+
7
+ ### Added
8
+
9
+ - `isOfType()` & `isOfTypeStrict()` now can be called from instances.
10
+
11
+ ## [1.2.7] - 2026-02-13
12
+
13
+ ### Added
14
+
15
+ - Support for `abstract` classes using `SigilifyAbstract` factory.
16
+
5
17
  ## [1.2.6] - 2026-02-11
6
18
 
7
19
  ### Changed
package/README.md CHANGED
@@ -86,6 +86,18 @@ class User extends Sigil {}
86
86
  const MyClass = Sigilify(class {}, '@myorg/mypkg.MyClass');
87
87
  ```
88
88
 
89
+ If your class is marked with `abstract`:
90
+
91
+ ```ts
92
+ import { Sigil, SigilifyAbstract } from '@vicin/sigil';
93
+
94
+ // Using the pre-sigilified base class:
95
+ abstract class User extends Sigil {}
96
+
97
+ // Or use Sigilify when you want an ad-hoc class:
98
+ const MyClass = SigilifyAbstract(abstract class {}, '@myorg/mypkg.MyClass');
99
+ ```
100
+
89
101
  This adds runtime metadata to the constructor and allows you to use runtime helpers, see [API reference](#api-reference).
90
102
 
91
103
  #### Extend `Sigil` classes
@@ -351,8 +363,9 @@ class X extends Sigil {
351
363
 
352
364
  ### Primary Exports
353
365
 
354
- - **Mixin:**
366
+ - **Mixins:**
355
367
  - `Sigilify(Base, label?, opts?)`
368
+ - `SigilifyAbstract(Base, label?, opts?)`
356
369
 
357
370
  - **Classes:**
358
371
  - `Sigil`
@@ -421,6 +434,8 @@ Instances of sigilified classes expose instance helpers:
421
434
  - `getSigilType()` — runtime symbol.
422
435
  - `getSigilTypeLineage()` — returns lineage array.
423
436
  - `getSigilTypeSet()` — returns readonly Set.
437
+ - `isOfType(other)` — O(1) membership test using `other`'s `__TYPE_SET__`.
438
+ - `isOfTypeStrict(other)` — strict lineage comparison element-by-element.
424
439
 
425
440
  ---
426
441
 
package/dist/index.d.mts CHANGED
@@ -400,14 +400,10 @@ interface ISigilInstance<L extends string = string, P extends Function = never>
400
400
  /**
401
401
  * Combined constructor + static interface for a sigil class.
402
402
  *
403
- * This composes the instance-side shape (Constructor<ISigilInstance<L>>) with
404
- * the static-side interface (ISigilStatic<L>), matching the runtime shape added
405
- * by `Sigilify`.
406
- *
407
403
  * @template L - Narrow string literal type for the label.
408
404
  * @template P - Optinal parent to extend its '__SIGIL_BRAND__'.
409
405
  */
410
- type ISigil<L extends string = string, P extends Function = never> = Constructor<ISigilInstance<L, P>> & ISigilStatic<L, P>;
406
+ type ISigil<L extends string = string, P extends Function = never> = ConstructorAbstract<ISigilInstance<L, P>> & ISigilStatic<L, P>;
411
407
  /** -----------------------------------------
412
408
  * HOF pattern types
413
409
  * ----------------------------------------- */
@@ -418,15 +414,16 @@ type ISigil<L extends string = string, P extends Function = never> = Constructor
418
414
  * @template S - The original Untyped Sigil constructor type being augmented.
419
415
  * @template L - The new label literal to associate with the resulting constructor.
420
416
  */
421
- type TypedSigil<S extends Function, L extends string = string> = S & AppendLabel<L> & Constructor<AppendLabel<L>>;
417
+ type TypedSigil<S extends Function, L extends string = string> = S & AppendLabel<L> & ConstructorAbstract<AppendLabel<L>>;
422
418
  /**
423
419
  * Generic helper extract instance of the class even in protected and private constructors.
420
+ * @remark Return same type is passed type has no 'prototype'
424
421
  */
425
422
  type GetInstance<T> = T extends {
426
423
  prototype: infer R;
427
424
  } ? PrettifyBrand<R & {
428
425
  __SIGIL_BRAND__: SigilBrandOf<T>;
429
- }> : never;
426
+ }> : T;
430
427
  /** Helper to append label into a class. */
431
428
  type AppendLabel<L extends string> = {
432
429
  readonly __SIGIL_BRAND__: Prettify<{
@@ -468,6 +465,16 @@ type SigilBrandOf<S> = IfNever<S extends {
468
465
  * @template P - Parameter tuple type for the constructor.
469
466
  */
470
467
  type Constructor<T = object, P extends any[] = any[]> = new (...args: P) => T;
468
+ /**
469
+ * Generic type for class constructors used by the Sigil utilities. for 'abstract classes'.
470
+ *
471
+ * - `T` is the instance type produced by the constructor.
472
+ * - `P` is the tuple of parameter types accepted by the constructor.
473
+ *
474
+ * @template T - Instance type produced by the constructor (defaults to `object`).
475
+ * @template P - Parameter tuple type for the constructor.
476
+ */
477
+ type ConstructorAbstract<T = object, P extends any[] = any[]> = abstract new (...args: P) => T;
471
478
  /** Helper type to prettify value */
472
479
  type Prettify<T> = {
473
480
  [K in keyof T]: T[K];
@@ -490,6 +497,8 @@ declare const Sigil: {
490
497
  readonly __SIGIL_BRAND__: {
491
498
  Sigil: true;
492
499
  };
500
+ isOfType<T>(this: T, other: unknown): other is GetInstance<T>;
501
+ isOfTypeStrict<T>(this: T, other: unknown): other is /*elided*/ any;
493
502
  getSigilLabel(): string;
494
503
  getSigilType(): symbol;
495
504
  getSigilTypeLineage(): readonly symbol[];
@@ -522,6 +531,8 @@ declare const SigilError: {
522
531
  Sigil: true;
523
532
  SigilError: true;
524
533
  };
534
+ isOfType<T>(this: T, other: unknown): other is GetInstance<T>;
535
+ isOfTypeStrict<T>(this: T, other: unknown): other is /*elided*/ any;
525
536
  getSigilLabel(): string;
526
537
  getSigilType(): symbol;
527
538
  getSigilTypeLineage(): readonly symbol[];
@@ -684,16 +695,13 @@ declare function isInheritanceChecked(ctor: Function): boolean;
684
695
 
685
696
  /**
686
697
  * Mixin factory that augments an existing class with Sigil runtime metadata and
687
- * helpers. The returned class:
698
+ * helpers.
699
+ *
700
+ * The returned class:
688
701
  * - registers a stable symbol for the provided `label` (via `WithSigil`)
689
702
  * - exposes static helpers such as `SigilLabel`, `SigilType`, `isOfType`, and `isOfTypeStrict`
690
703
  * - exposes instance helpers such as `getSigilLabel`, `getSigilType`, etc.
691
704
  *
692
- * Notes:
693
- * - Uses `Symbol.for(label)` internally so symbols are stable across bundles/realms
694
- * that share the global symbol registry.
695
- * - Throws if `Base` is already a sigil constructor.
696
- *
697
705
  * @param Base - The base constructor to extend.
698
706
  * @param label - Optional identity label to attach to the resulting class (e.g. '@scope/pkg.ClassName').
699
707
  * If not passed a random label is generated instead.
@@ -713,6 +721,28 @@ declare function Sigilify<B extends Constructor, L extends string>(Base: B, labe
713
721
  readonly __SIGIL_BRAND__: {
714
722
  Sigil: true;
715
723
  } & { [K_1 in L]: true; } extends infer T ? { [K in keyof T]: T[K]; } : never;
724
+ /**
725
+ * Check whether `other` is (or inherits from) the type instance.
726
+ *
727
+ * Allows 'instanceof' like checks but in instances.
728
+ *
729
+ * @typeParam T - The instance type.
730
+ * @param this - The instance performing the check.
731
+ * @param other - The object to test.
732
+ * @returns `true` if `other` is the same instance of this type or a subtype.
733
+ */
734
+ isOfType<T_1>(this: T_1, other: unknown): other is GetInstance<T_1>;
735
+ /**
736
+ * Strict lineage check: compares the type symbol lineage arrays element-by-element.
737
+ *
738
+ * Allows 'instanceof' like checks but in instances.
739
+ *
740
+ * @typeParam T - The instance type.
741
+ * @param this - The instance performing the check.
742
+ * @param other - The object to test.
743
+ * @returns `true` if `other` has an identical lineage up to the length of this instance's lineage.
744
+ */
745
+ isOfTypeStrict<T_1>(this: T_1, other: unknown): other is /*elided*/ any;
716
746
  /**
717
747
  * Returns the human-readable sigil label of this instance's constructor.
718
748
  *
@@ -738,6 +768,146 @@ declare function Sigilify<B extends Constructor, L extends string>(Base: B, labe
738
768
  */
739
769
  getSigilTypeSet(): Readonly<Set<symbol>>;
740
770
  };
771
+ /**
772
+ * Compile-time nominal brand that encodes the class label `L` plus parent's brand keys `BrandOf<P>`.
773
+ *
774
+ * - HAVE NO RUN-TIME VALUE (undefined)
775
+ * - Provides a *type-only* unique marker that makes instances nominally
776
+ * distinct by label and allows propagation/merging of brand keys across inheritance.
777
+ */
778
+ readonly __SIGIL_BRAND__: Prettify<{
779
+ Sigil: true;
780
+ } & { [K in L]: true; }>;
781
+ /**
782
+ * Class-level human-readable label constant for this sigil constructor.
783
+ */
784
+ get SigilLabel(): string;
785
+ /**
786
+ * Class-level unique runtime symbol used as the type identifier.
787
+ *
788
+ * This symbol is created with `Symbol.for(label)` during decoration so it is
789
+ * stable across realms that share the same global symbol registry.
790
+ */
791
+ get SigilType(): symbol;
792
+ /**
793
+ * Copy of the linearized sigil type symbol chain for the current constructor.
794
+ *
795
+ * Useful for debugging and performing strict lineage comparisons.
796
+ *
797
+ * @returns An array of symbols representing parent → child type symbols.
798
+ */
799
+ get SigilTypeLineage(): readonly symbol[];
800
+ /**
801
+ * Copy of the sigil type symbol set for the current constructor.
802
+ *
803
+ * Useful for quick membership checks (O(1) lookups) and debugging.
804
+ *
805
+ * @returns A Readonly Set of symbols that represent the type lineage.
806
+ */
807
+ get SigilTypeSet(): Readonly<Set<symbol>>;
808
+ /**
809
+ * Runtime predicate indicating whether `obj` is an instance produced by a sigil class.
810
+ *
811
+ * @param obj - The value to test.
812
+ * @returns `true` if `obj` is a sigil instance.
813
+ */
814
+ isSigilified(obj: unknown): obj is ISigil;
815
+ /**
816
+ * Check whether `other` is (or inherits from) the type represented by the calling constructor.
817
+ *
818
+ * This replaces `instanceof` so that checks remain valid across bundles/realms
819
+ * and when subclassing.
820
+ *
821
+ * @typeParam T - The calling constructor type (narrowing the returned instance type).
822
+ * @param this - The constructor performing the check.
823
+ * @param other - The object to test.
824
+ * @returns `true` if `other` is an instance of this type or a subtype.
825
+ */
826
+ isOfType<T>(this: T, other: unknown): other is GetInstance<T>;
827
+ /**
828
+ * Strict lineage check: compares the type symbol lineage arrays element-by-element.
829
+ *
830
+ * @typeParam T - The calling constructor type.
831
+ * @param this - The constructor performing the check.
832
+ * @param other - The object to test.
833
+ * @returns `true` if `other` has an identical lineage up to the length of this constructor's lineage.
834
+ */
835
+ isOfTypeStrict<T>(this: T, other: unknown): other is GetInstance<T>;
836
+ } & B;
837
+ /**
838
+ * Mixin factory that augments an existing class with Sigil runtime metadata and
839
+ * helpers. Accept and return 'abstract' class.
840
+ *
841
+ * The returned class:
842
+ * - registers a stable symbol for the provided `label` (via `WithSigil`)
843
+ * - exposes static helpers such as `SigilLabel`, `SigilType`, `isOfType`, and `isOfTypeStrict`
844
+ * - exposes instance helpers such as `getSigilLabel`, `getSigilType`, etc.
845
+ *
846
+ * @param Base - The base constructor to extend.
847
+ * @param label - Optional identity label to attach to the resulting class (e.g. '@scope/pkg.ClassName').
848
+ * If not passed a random label is generated instead.
849
+ * @param opts - Options object to override any global options if needed.
850
+ * @returns A new abstract constructor that extends `Base` and includes Sigil statics/instance methods.
851
+ * @throws Error if `Base` is already sigilized.
852
+ */
853
+ declare function SigilifyAbstract<B extends ConstructorAbstract, L extends string>(Base: B, label?: L, opts?: SigilOptions): ((abstract new (...args: any[]) => {
854
+ /**
855
+ * Compile-time nominal brand that encodes the class label `L` plus parent's brand keys `BrandOf<P>`.
856
+ *
857
+ * - HAVE NO RUN-TIME VALUE (undefined)
858
+ * - Provides a *type-only* unique marker that makes instances nominally
859
+ * distinct by label and allows propagation/merging of brand keys across inheritance.
860
+ */
861
+ readonly __SIGIL_BRAND__: {
862
+ Sigil: true;
863
+ } & { [K_1 in L]: true; } extends infer T ? { [K in keyof T]: T[K]; } : never;
864
+ /**
865
+ * Check whether `other` is (or inherits from) the type instance.
866
+ *
867
+ * Allows 'instanceof' like checks but in instances.
868
+ *
869
+ * @typeParam T - The instance type.
870
+ * @param this - The instance performing the check.
871
+ * @param other - The object to test.
872
+ * @returns `true` if `other` is the same instance of this type or a subtype.
873
+ */
874
+ isOfType<T_1>(this: T_1, other: unknown): other is GetInstance<T_1>;
875
+ /**
876
+ * Strict lineage check: compares the type symbol lineage arrays element-by-element.
877
+ *
878
+ * Allows 'instanceof' like checks but in instances.
879
+ *
880
+ * @typeParam T - The instance type.
881
+ * @param this - The instance performing the check.
882
+ * @param other - The object to test.
883
+ * @returns `true` if `other` has an identical lineage up to the length of this instance's lineage.
884
+ */
885
+ isOfTypeStrict<T_1>(this: T_1, other: unknown): other is /*elided*/ any;
886
+ /**
887
+ * Returns the human-readable sigil label of this instance's constructor.
888
+ *
889
+ * @returns The label string (e.g. '@scope/pkg.ClassName') or '@Sigil.unknown' in DEV when constructor is missing.
890
+ */
891
+ getSigilLabel(): string;
892
+ /**
893
+ * Returns the runtime sigil type symbol of this instance's constructor.
894
+ *
895
+ * @returns The symbol that identifies this type at runtime.
896
+ */
897
+ getSigilType(): symbol;
898
+ /**
899
+ * Returns a copy of the sigil type symbol lineage for this instance's constructor.
900
+ *
901
+ * @returns readonly array of symbols representing the type lineage.
902
+ */
903
+ getSigilTypeLineage(): readonly symbol[];
904
+ /**
905
+ * Returns a readonly copy of the sigil type symbol set for this instance's constructor.
906
+ *
907
+ * @returns A Readonly Set of symbols representing the type lineage for O(1) membership tests.
908
+ */
909
+ getSigilTypeSet(): Readonly<Set<symbol>>;
910
+ }) & {
741
911
  /**
742
912
  * Compile-time nominal brand that encodes the class label `L` plus parent's brand keys `BrandOf<P>`.
743
913
  *
@@ -811,6 +981,6 @@ declare function Sigilify<B extends Constructor, L extends string>(Base: B, labe
811
981
  * @returns `true` if `other` has an identical lineage up to the length of this constructor's lineage.
812
982
  */
813
983
  isOfTypeStrict<T>(this: T, other: unknown): other is GetInstance<T>;
814
- } & B;
984
+ }) & B;
815
985
 
816
- export { DEFAULT_LABEL_REGEX, type GetInstance, type ISigil, type ISigilInstance, type ISigilStatic, REGISTRY, Sigil, type SigilBrandOf, SigilError, type SigilOptions, SigilRegistry, Sigilify, type TypedSigil, type UpdateSigilBrand, WithSigil, getActiveRegistry, isDecorated, isInheritanceChecked, isSigilBaseCtor, isSigilBaseInstance, isSigilCtor, isSigilInstance, typed, updateOptions, withSigil, withSigilTyped };
986
+ export { DEFAULT_LABEL_REGEX, type GetInstance, type ISigil, type ISigilInstance, type ISigilStatic, REGISTRY, Sigil, type SigilBrandOf, SigilError, type SigilOptions, SigilRegistry, Sigilify, SigilifyAbstract, type TypedSigil, type UpdateSigilBrand, WithSigil, getActiveRegistry, isDecorated, isInheritanceChecked, isSigilBaseCtor, isSigilBaseInstance, isSigilCtor, isSigilInstance, typed, updateOptions, withSigil, withSigilTyped };
package/dist/index.d.ts CHANGED
@@ -400,14 +400,10 @@ interface ISigilInstance<L extends string = string, P extends Function = never>
400
400
  /**
401
401
  * Combined constructor + static interface for a sigil class.
402
402
  *
403
- * This composes the instance-side shape (Constructor<ISigilInstance<L>>) with
404
- * the static-side interface (ISigilStatic<L>), matching the runtime shape added
405
- * by `Sigilify`.
406
- *
407
403
  * @template L - Narrow string literal type for the label.
408
404
  * @template P - Optinal parent to extend its '__SIGIL_BRAND__'.
409
405
  */
410
- type ISigil<L extends string = string, P extends Function = never> = Constructor<ISigilInstance<L, P>> & ISigilStatic<L, P>;
406
+ type ISigil<L extends string = string, P extends Function = never> = ConstructorAbstract<ISigilInstance<L, P>> & ISigilStatic<L, P>;
411
407
  /** -----------------------------------------
412
408
  * HOF pattern types
413
409
  * ----------------------------------------- */
@@ -418,15 +414,16 @@ type ISigil<L extends string = string, P extends Function = never> = Constructor
418
414
  * @template S - The original Untyped Sigil constructor type being augmented.
419
415
  * @template L - The new label literal to associate with the resulting constructor.
420
416
  */
421
- type TypedSigil<S extends Function, L extends string = string> = S & AppendLabel<L> & Constructor<AppendLabel<L>>;
417
+ type TypedSigil<S extends Function, L extends string = string> = S & AppendLabel<L> & ConstructorAbstract<AppendLabel<L>>;
422
418
  /**
423
419
  * Generic helper extract instance of the class even in protected and private constructors.
420
+ * @remark Return same type is passed type has no 'prototype'
424
421
  */
425
422
  type GetInstance<T> = T extends {
426
423
  prototype: infer R;
427
424
  } ? PrettifyBrand<R & {
428
425
  __SIGIL_BRAND__: SigilBrandOf<T>;
429
- }> : never;
426
+ }> : T;
430
427
  /** Helper to append label into a class. */
431
428
  type AppendLabel<L extends string> = {
432
429
  readonly __SIGIL_BRAND__: Prettify<{
@@ -468,6 +465,16 @@ type SigilBrandOf<S> = IfNever<S extends {
468
465
  * @template P - Parameter tuple type for the constructor.
469
466
  */
470
467
  type Constructor<T = object, P extends any[] = any[]> = new (...args: P) => T;
468
+ /**
469
+ * Generic type for class constructors used by the Sigil utilities. for 'abstract classes'.
470
+ *
471
+ * - `T` is the instance type produced by the constructor.
472
+ * - `P` is the tuple of parameter types accepted by the constructor.
473
+ *
474
+ * @template T - Instance type produced by the constructor (defaults to `object`).
475
+ * @template P - Parameter tuple type for the constructor.
476
+ */
477
+ type ConstructorAbstract<T = object, P extends any[] = any[]> = abstract new (...args: P) => T;
471
478
  /** Helper type to prettify value */
472
479
  type Prettify<T> = {
473
480
  [K in keyof T]: T[K];
@@ -490,6 +497,8 @@ declare const Sigil: {
490
497
  readonly __SIGIL_BRAND__: {
491
498
  Sigil: true;
492
499
  };
500
+ isOfType<T>(this: T, other: unknown): other is GetInstance<T>;
501
+ isOfTypeStrict<T>(this: T, other: unknown): other is /*elided*/ any;
493
502
  getSigilLabel(): string;
494
503
  getSigilType(): symbol;
495
504
  getSigilTypeLineage(): readonly symbol[];
@@ -522,6 +531,8 @@ declare const SigilError: {
522
531
  Sigil: true;
523
532
  SigilError: true;
524
533
  };
534
+ isOfType<T>(this: T, other: unknown): other is GetInstance<T>;
535
+ isOfTypeStrict<T>(this: T, other: unknown): other is /*elided*/ any;
525
536
  getSigilLabel(): string;
526
537
  getSigilType(): symbol;
527
538
  getSigilTypeLineage(): readonly symbol[];
@@ -684,16 +695,13 @@ declare function isInheritanceChecked(ctor: Function): boolean;
684
695
 
685
696
  /**
686
697
  * Mixin factory that augments an existing class with Sigil runtime metadata and
687
- * helpers. The returned class:
698
+ * helpers.
699
+ *
700
+ * The returned class:
688
701
  * - registers a stable symbol for the provided `label` (via `WithSigil`)
689
702
  * - exposes static helpers such as `SigilLabel`, `SigilType`, `isOfType`, and `isOfTypeStrict`
690
703
  * - exposes instance helpers such as `getSigilLabel`, `getSigilType`, etc.
691
704
  *
692
- * Notes:
693
- * - Uses `Symbol.for(label)` internally so symbols are stable across bundles/realms
694
- * that share the global symbol registry.
695
- * - Throws if `Base` is already a sigil constructor.
696
- *
697
705
  * @param Base - The base constructor to extend.
698
706
  * @param label - Optional identity label to attach to the resulting class (e.g. '@scope/pkg.ClassName').
699
707
  * If not passed a random label is generated instead.
@@ -713,6 +721,28 @@ declare function Sigilify<B extends Constructor, L extends string>(Base: B, labe
713
721
  readonly __SIGIL_BRAND__: {
714
722
  Sigil: true;
715
723
  } & { [K_1 in L]: true; } extends infer T ? { [K in keyof T]: T[K]; } : never;
724
+ /**
725
+ * Check whether `other` is (or inherits from) the type instance.
726
+ *
727
+ * Allows 'instanceof' like checks but in instances.
728
+ *
729
+ * @typeParam T - The instance type.
730
+ * @param this - The instance performing the check.
731
+ * @param other - The object to test.
732
+ * @returns `true` if `other` is the same instance of this type or a subtype.
733
+ */
734
+ isOfType<T_1>(this: T_1, other: unknown): other is GetInstance<T_1>;
735
+ /**
736
+ * Strict lineage check: compares the type symbol lineage arrays element-by-element.
737
+ *
738
+ * Allows 'instanceof' like checks but in instances.
739
+ *
740
+ * @typeParam T - The instance type.
741
+ * @param this - The instance performing the check.
742
+ * @param other - The object to test.
743
+ * @returns `true` if `other` has an identical lineage up to the length of this instance's lineage.
744
+ */
745
+ isOfTypeStrict<T_1>(this: T_1, other: unknown): other is /*elided*/ any;
716
746
  /**
717
747
  * Returns the human-readable sigil label of this instance's constructor.
718
748
  *
@@ -738,6 +768,146 @@ declare function Sigilify<B extends Constructor, L extends string>(Base: B, labe
738
768
  */
739
769
  getSigilTypeSet(): Readonly<Set<symbol>>;
740
770
  };
771
+ /**
772
+ * Compile-time nominal brand that encodes the class label `L` plus parent's brand keys `BrandOf<P>`.
773
+ *
774
+ * - HAVE NO RUN-TIME VALUE (undefined)
775
+ * - Provides a *type-only* unique marker that makes instances nominally
776
+ * distinct by label and allows propagation/merging of brand keys across inheritance.
777
+ */
778
+ readonly __SIGIL_BRAND__: Prettify<{
779
+ Sigil: true;
780
+ } & { [K in L]: true; }>;
781
+ /**
782
+ * Class-level human-readable label constant for this sigil constructor.
783
+ */
784
+ get SigilLabel(): string;
785
+ /**
786
+ * Class-level unique runtime symbol used as the type identifier.
787
+ *
788
+ * This symbol is created with `Symbol.for(label)` during decoration so it is
789
+ * stable across realms that share the same global symbol registry.
790
+ */
791
+ get SigilType(): symbol;
792
+ /**
793
+ * Copy of the linearized sigil type symbol chain for the current constructor.
794
+ *
795
+ * Useful for debugging and performing strict lineage comparisons.
796
+ *
797
+ * @returns An array of symbols representing parent → child type symbols.
798
+ */
799
+ get SigilTypeLineage(): readonly symbol[];
800
+ /**
801
+ * Copy of the sigil type symbol set for the current constructor.
802
+ *
803
+ * Useful for quick membership checks (O(1) lookups) and debugging.
804
+ *
805
+ * @returns A Readonly Set of symbols that represent the type lineage.
806
+ */
807
+ get SigilTypeSet(): Readonly<Set<symbol>>;
808
+ /**
809
+ * Runtime predicate indicating whether `obj` is an instance produced by a sigil class.
810
+ *
811
+ * @param obj - The value to test.
812
+ * @returns `true` if `obj` is a sigil instance.
813
+ */
814
+ isSigilified(obj: unknown): obj is ISigil;
815
+ /**
816
+ * Check whether `other` is (or inherits from) the type represented by the calling constructor.
817
+ *
818
+ * This replaces `instanceof` so that checks remain valid across bundles/realms
819
+ * and when subclassing.
820
+ *
821
+ * @typeParam T - The calling constructor type (narrowing the returned instance type).
822
+ * @param this - The constructor performing the check.
823
+ * @param other - The object to test.
824
+ * @returns `true` if `other` is an instance of this type or a subtype.
825
+ */
826
+ isOfType<T>(this: T, other: unknown): other is GetInstance<T>;
827
+ /**
828
+ * Strict lineage check: compares the type symbol lineage arrays element-by-element.
829
+ *
830
+ * @typeParam T - The calling constructor type.
831
+ * @param this - The constructor performing the check.
832
+ * @param other - The object to test.
833
+ * @returns `true` if `other` has an identical lineage up to the length of this constructor's lineage.
834
+ */
835
+ isOfTypeStrict<T>(this: T, other: unknown): other is GetInstance<T>;
836
+ } & B;
837
+ /**
838
+ * Mixin factory that augments an existing class with Sigil runtime metadata and
839
+ * helpers. Accept and return 'abstract' class.
840
+ *
841
+ * The returned class:
842
+ * - registers a stable symbol for the provided `label` (via `WithSigil`)
843
+ * - exposes static helpers such as `SigilLabel`, `SigilType`, `isOfType`, and `isOfTypeStrict`
844
+ * - exposes instance helpers such as `getSigilLabel`, `getSigilType`, etc.
845
+ *
846
+ * @param Base - The base constructor to extend.
847
+ * @param label - Optional identity label to attach to the resulting class (e.g. '@scope/pkg.ClassName').
848
+ * If not passed a random label is generated instead.
849
+ * @param opts - Options object to override any global options if needed.
850
+ * @returns A new abstract constructor that extends `Base` and includes Sigil statics/instance methods.
851
+ * @throws Error if `Base` is already sigilized.
852
+ */
853
+ declare function SigilifyAbstract<B extends ConstructorAbstract, L extends string>(Base: B, label?: L, opts?: SigilOptions): ((abstract new (...args: any[]) => {
854
+ /**
855
+ * Compile-time nominal brand that encodes the class label `L` plus parent's brand keys `BrandOf<P>`.
856
+ *
857
+ * - HAVE NO RUN-TIME VALUE (undefined)
858
+ * - Provides a *type-only* unique marker that makes instances nominally
859
+ * distinct by label and allows propagation/merging of brand keys across inheritance.
860
+ */
861
+ readonly __SIGIL_BRAND__: {
862
+ Sigil: true;
863
+ } & { [K_1 in L]: true; } extends infer T ? { [K in keyof T]: T[K]; } : never;
864
+ /**
865
+ * Check whether `other` is (or inherits from) the type instance.
866
+ *
867
+ * Allows 'instanceof' like checks but in instances.
868
+ *
869
+ * @typeParam T - The instance type.
870
+ * @param this - The instance performing the check.
871
+ * @param other - The object to test.
872
+ * @returns `true` if `other` is the same instance of this type or a subtype.
873
+ */
874
+ isOfType<T_1>(this: T_1, other: unknown): other is GetInstance<T_1>;
875
+ /**
876
+ * Strict lineage check: compares the type symbol lineage arrays element-by-element.
877
+ *
878
+ * Allows 'instanceof' like checks but in instances.
879
+ *
880
+ * @typeParam T - The instance type.
881
+ * @param this - The instance performing the check.
882
+ * @param other - The object to test.
883
+ * @returns `true` if `other` has an identical lineage up to the length of this instance's lineage.
884
+ */
885
+ isOfTypeStrict<T_1>(this: T_1, other: unknown): other is /*elided*/ any;
886
+ /**
887
+ * Returns the human-readable sigil label of this instance's constructor.
888
+ *
889
+ * @returns The label string (e.g. '@scope/pkg.ClassName') or '@Sigil.unknown' in DEV when constructor is missing.
890
+ */
891
+ getSigilLabel(): string;
892
+ /**
893
+ * Returns the runtime sigil type symbol of this instance's constructor.
894
+ *
895
+ * @returns The symbol that identifies this type at runtime.
896
+ */
897
+ getSigilType(): symbol;
898
+ /**
899
+ * Returns a copy of the sigil type symbol lineage for this instance's constructor.
900
+ *
901
+ * @returns readonly array of symbols representing the type lineage.
902
+ */
903
+ getSigilTypeLineage(): readonly symbol[];
904
+ /**
905
+ * Returns a readonly copy of the sigil type symbol set for this instance's constructor.
906
+ *
907
+ * @returns A Readonly Set of symbols representing the type lineage for O(1) membership tests.
908
+ */
909
+ getSigilTypeSet(): Readonly<Set<symbol>>;
910
+ }) & {
741
911
  /**
742
912
  * Compile-time nominal brand that encodes the class label `L` plus parent's brand keys `BrandOf<P>`.
743
913
  *
@@ -811,6 +981,6 @@ declare function Sigilify<B extends Constructor, L extends string>(Base: B, labe
811
981
  * @returns `true` if `other` has an identical lineage up to the length of this constructor's lineage.
812
982
  */
813
983
  isOfTypeStrict<T>(this: T, other: unknown): other is GetInstance<T>;
814
- } & B;
984
+ }) & B;
815
985
 
816
- export { DEFAULT_LABEL_REGEX, type GetInstance, type ISigil, type ISigilInstance, type ISigilStatic, REGISTRY, Sigil, type SigilBrandOf, SigilError, type SigilOptions, SigilRegistry, Sigilify, type TypedSigil, type UpdateSigilBrand, WithSigil, getActiveRegistry, isDecorated, isInheritanceChecked, isSigilBaseCtor, isSigilBaseInstance, isSigilCtor, isSigilInstance, typed, updateOptions, withSigil, withSigilTyped };
986
+ export { DEFAULT_LABEL_REGEX, type GetInstance, type ISigil, type ISigilInstance, type ISigilStatic, REGISTRY, Sigil, type SigilBrandOf, SigilError, type SigilOptions, SigilRegistry, Sigilify, SigilifyAbstract, type TypedSigil, type UpdateSigilBrand, WithSigil, getActiveRegistry, isDecorated, isInheritanceChecked, isSigilBaseCtor, isSigilBaseInstance, isSigilCtor, isSigilInstance, typed, updateOptions, withSigil, withSigilTyped };