modern-idoc 0.9.11 → 0.10.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/dist/index.d.cts +13 -14
- package/dist/index.d.mts +13 -14
- package/dist/index.d.ts +13 -14
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -814,12 +814,12 @@ type EventListenerValue<T extends any[] = any[]> = (...args: T) => void;
|
|
|
814
814
|
type EventListenerOptions = boolean | {
|
|
815
815
|
once?: boolean;
|
|
816
816
|
};
|
|
817
|
-
interface EventListener
|
|
817
|
+
interface EventListener<T extends any[] = any[]> {
|
|
818
818
|
value: EventListenerValue<T>;
|
|
819
819
|
options?: EventListenerOptions;
|
|
820
820
|
}
|
|
821
821
|
declare class EventEmitter<T extends Record<string, any> = Record<string, any>> {
|
|
822
|
-
eventListeners: Map<keyof T, EventListener
|
|
822
|
+
eventListeners: Map<keyof T, EventListener<any[]> | EventListener<any[]>[]>;
|
|
823
823
|
addEventListener<K extends keyof T>(event: K, listener: EventListenerValue<T[K]>, options?: EventListenerOptions): this;
|
|
824
824
|
removeEventListener<K extends keyof T>(event: K, listener: EventListenerValue<T[K]>, options?: EventListenerOptions): this;
|
|
825
825
|
removeAllListeners(): this;
|
|
@@ -842,16 +842,15 @@ declare function setNestedValue(obj: any, path: (string | number)[], value: any)
|
|
|
842
842
|
declare function getObjectValueByPath(obj: any, path: string, fallback?: any): any;
|
|
843
843
|
declare function setObjectValueByPath(obj: any, path: string, value: any): void;
|
|
844
844
|
|
|
845
|
-
type EventListener = (...args: any[]) => void;
|
|
846
845
|
interface ObservableEvents {
|
|
847
|
-
[event: string]:
|
|
846
|
+
[event: string]: any[];
|
|
848
847
|
}
|
|
849
848
|
declare class Observable<T extends ObservableEvents = ObservableEvents> {
|
|
850
849
|
_observers: Map<string, Set<any>>;
|
|
851
|
-
on<K extends keyof T & string>(event: K, listener: T[K]): this;
|
|
852
|
-
once<K extends keyof T & string>(event: K, listener: T[K]): this;
|
|
853
|
-
off<K extends keyof T & string>(event: K, listener: T[K]): this;
|
|
854
|
-
emit<K extends keyof T & string>(event: K, ...args:
|
|
850
|
+
on<K extends keyof T & string>(event: K, listener: (...args: T[K]) => void): this;
|
|
851
|
+
once<K extends keyof T & string>(event: K, listener: (...args: T[K]) => void): this;
|
|
852
|
+
off<K extends keyof T & string>(event: K, listener: (...args: T[K]) => void): this;
|
|
853
|
+
emit<K extends keyof T & string>(event: K, ...args: T[K]): this;
|
|
855
854
|
destroy(): void;
|
|
856
855
|
}
|
|
857
856
|
|
|
@@ -865,13 +864,13 @@ declare class RawWeakMap<K extends WeakKey = WeakKey, V = any> {
|
|
|
865
864
|
}
|
|
866
865
|
|
|
867
866
|
interface ReactivableEvents extends ObservableEvents {
|
|
868
|
-
updateProperty:
|
|
867
|
+
updateProperty: [key: string, newValue: any, oldValue: any];
|
|
869
868
|
}
|
|
870
869
|
interface Reactivable {
|
|
871
|
-
on: <K extends keyof ReactivableEvents & string>(event: K, listener: ReactivableEvents[K]) => this;
|
|
872
|
-
once: <K extends keyof ReactivableEvents & string>(event: K, listener: ReactivableEvents[K]) => this;
|
|
873
|
-
off: <K extends keyof ReactivableEvents & string>(event: K, listener: ReactivableEvents[K]) => this;
|
|
874
|
-
emit: <K extends keyof ReactivableEvents & string>(event: K, ...args:
|
|
870
|
+
on: <K extends keyof ReactivableEvents & string>(event: K, listener: (...args: ReactivableEvents[K]) => void) => this;
|
|
871
|
+
once: <K extends keyof ReactivableEvents & string>(event: K, listener: (...args: ReactivableEvents[K]) => void) => this;
|
|
872
|
+
off: <K extends keyof ReactivableEvents & string>(event: K, listener: (...args: ReactivableEvents[K]) => void) => this;
|
|
873
|
+
emit: <K extends keyof ReactivableEvents & string>(event: K, ...args: ReactivableEvents[K]) => this;
|
|
875
874
|
}
|
|
876
875
|
declare class Reactivable extends Observable implements PropertyAccessor {
|
|
877
876
|
protected _propertyAccessor?: PropertyAccessor;
|
|
@@ -902,4 +901,4 @@ declare class Reactivable extends Observable implements PropertyAccessor {
|
|
|
902
901
|
}
|
|
903
902
|
|
|
904
903
|
export { EventEmitter, Observable, RawWeakMap, Reactivable, clearUndef, defaultColor, defineProperty, flatDocumentToDocument, getDeclarations, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultInnerShadow, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultOuterShadow, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, getNestedValue, getObjectValueByPath, getPropertyDescriptor, hasCRLF, idGenerator, isCRLF, isColor, isColorFill, isColorFillObject, isEqualObject, isFragmentObject, isGradient, isGradientFill, isGradientFillObject, isImageFill, isImageFillObject, isNone, isParagraphObject, isPresetFill, isPresetFillObject, nanoid, normalizeAudio, normalizeBackground, normalizeCRLF, normalizeColor, normalizeColorFill, normalizeDocument, normalizeEffect, normalizeElement, normalizeFill, normalizeFlatDocument, normalizeForeground, normalizeGradient, normalizeGradientFill, normalizeImageFill, normalizeInnerShadow, normalizeOuterShadow, normalizeOutline, normalizePresetFill, normalizeShadow, normalizeShape, normalizeSoftEdge, normalizeStyle, normalizeText, normalizeTextContent, normalizeVideo, parseColor, parseGradient, pick, property, property2, propertyOffsetDefaultValue, propertyOffsetGet, propertyOffsetSet, round, setNestedValue, setObjectValueByPath, stringifyGradient, textContentToString };
|
|
905
|
-
export type { Align, AngularNode, Audio, Background, BackgroundObject, BackgroundSize, BorderStyle, BoxShadow, BoxSizing, CmykColor, CmykaColor, Color, ColorFill, ColorFillObject, ColorStop, ColorStopNode, DefaultRadialNode, Direction, DirectionalNode, Display, Document, Effect, EffectObject, Element, EmNode, EventListenerOptions, EventListenerValue, ExtentKeywordNode, Fill, FillObject, FillRule, FlatDocument, FlatElement, FlatTextContent, FlexDirection, FlexWrap, FontKerning, FontStyle, FontWeight, Foreground, ForegroundObject, FragmentObject, FullStyle, GradientFill, GradientFillObject, GradientNode, HeadEnd, Hex8Color, HexNode, HighlightColormap, HighlightImage, HighlightLine, HighlightReferImage, HighlightSize, HighlightThickness, HslColor, HslaColor, HsvColor, HsvaColor, HwbColor, HwbaColor, IdGenerator, ImageFill, ImageFillCropRect, ImageFillObject, ImageFillStretchRect, ImageFillTile, InnerShadow, InnerShadowObject, Justify, LabColor, LabaColor, LchColor, LchaColor, LineCap, LineEndSize, LineEndType, LineJoin, LinearGradient, LinearGradientNode, LinearGradientWithType, ListStyleColormap, ListStyleImage, ListStylePosition, ListStyleSize, ListStyleType, LiteralNode, Meta, Node, None, NormalizedAudio, NormalizedBackground, NormalizedBaseBackground, NormalizedBaseForeground, NormalizedBaseOuterShadow, NormalizedBaseOutline, NormalizedColor, NormalizedColorFill, NormalizedDocument, NormalizedEffect, NormalizedElement, NormalizedElementStyle, NormalizedFill, NormalizedFlatDocument, NormalizedFlatElement, NormalizedForeground, NormalizedFragment, NormalizedGradientFill, NormalizedHighlight, NormalizedHighlightStyle, NormalizedImageFill, NormalizedInnerShadow, NormalizedLayoutStyle, NormalizedListStyle, NormalizedListStyleStyle, NormalizedOuterShadow, NormalizedOutline, NormalizedParagraph, NormalizedPresetFill, NormalizedShadow, NormalizedShadowStyle, NormalizedShape, NormalizedSoftEdge, NormalizedStyle, NormalizedText, NormalizedTextContent, NormalizedTextDrawStyle, NormalizedTextInlineStyle, NormalizedTextLineStyle, NormalizedTextStyle, NormalizedTransformStyle, NormalizedVideo, ObjectColor, ObservableEvents, OuterShadow, OuterShadowObject, Outline, OutlineObject, OutlineStyle, Overflow, ParagraphObject, PercentNode, PointerEvents, Position, PositionKeywordNode, PositionNode, PresetFill, PresetFillObject, PropertyAccessor, PropertyDeclaration, PxNode, RadialGradient, RadialGradientNode, RadialGradientWithType, ReactivableEvents, RepeatingLinearGradientNode, RepeatingRadialGradientNode, RgbColor, RgbNode, RgbaColor, RgbaNode, SVGPathData, Shadow, ShadowObject, Shape, ShapeNode, ShapePath, ShapePathStyle, SoftEdge, StrokeLinecap, StrokeLinejoin, Style, StyleObject, StyleUnit, TailEnd, Text, TextAlign, TextContent, TextDecoration, TextObject, TextOrientation, TextTransform, TextWrap, Uint32Color, VerticalAlign, Video, Visibility, WithNone, WithStyleNone, WritingMode, XyzColor, XyzaColor };
|
|
904
|
+
export type { Align, AngularNode, Audio, Background, BackgroundObject, BackgroundSize, BorderStyle, BoxShadow, BoxSizing, CmykColor, CmykaColor, Color, ColorFill, ColorFillObject, ColorStop, ColorStopNode, DefaultRadialNode, Direction, DirectionalNode, Display, Document, Effect, EffectObject, Element, EmNode, EventListener, EventListenerOptions, EventListenerValue, ExtentKeywordNode, Fill, FillObject, FillRule, FlatDocument, FlatElement, FlatTextContent, FlexDirection, FlexWrap, FontKerning, FontStyle, FontWeight, Foreground, ForegroundObject, FragmentObject, FullStyle, GradientFill, GradientFillObject, GradientNode, HeadEnd, Hex8Color, HexNode, HighlightColormap, HighlightImage, HighlightLine, HighlightReferImage, HighlightSize, HighlightThickness, HslColor, HslaColor, HsvColor, HsvaColor, HwbColor, HwbaColor, IdGenerator, ImageFill, ImageFillCropRect, ImageFillObject, ImageFillStretchRect, ImageFillTile, InnerShadow, InnerShadowObject, Justify, LabColor, LabaColor, LchColor, LchaColor, LineCap, LineEndSize, LineEndType, LineJoin, LinearGradient, LinearGradientNode, LinearGradientWithType, ListStyleColormap, ListStyleImage, ListStylePosition, ListStyleSize, ListStyleType, LiteralNode, Meta, Node, None, NormalizedAudio, NormalizedBackground, NormalizedBaseBackground, NormalizedBaseForeground, NormalizedBaseOuterShadow, NormalizedBaseOutline, NormalizedColor, NormalizedColorFill, NormalizedDocument, NormalizedEffect, NormalizedElement, NormalizedElementStyle, NormalizedFill, NormalizedFlatDocument, NormalizedFlatElement, NormalizedForeground, NormalizedFragment, NormalizedGradientFill, NormalizedHighlight, NormalizedHighlightStyle, NormalizedImageFill, NormalizedInnerShadow, NormalizedLayoutStyle, NormalizedListStyle, NormalizedListStyleStyle, NormalizedOuterShadow, NormalizedOutline, NormalizedParagraph, NormalizedPresetFill, NormalizedShadow, NormalizedShadowStyle, NormalizedShape, NormalizedSoftEdge, NormalizedStyle, NormalizedText, NormalizedTextContent, NormalizedTextDrawStyle, NormalizedTextInlineStyle, NormalizedTextLineStyle, NormalizedTextStyle, NormalizedTransformStyle, NormalizedVideo, ObjectColor, ObservableEvents, OuterShadow, OuterShadowObject, Outline, OutlineObject, OutlineStyle, Overflow, ParagraphObject, PercentNode, PointerEvents, Position, PositionKeywordNode, PositionNode, PresetFill, PresetFillObject, PropertyAccessor, PropertyDeclaration, PxNode, RadialGradient, RadialGradientNode, RadialGradientWithType, ReactivableEvents, RepeatingLinearGradientNode, RepeatingRadialGradientNode, RgbColor, RgbNode, RgbaColor, RgbaNode, SVGPathData, Shadow, ShadowObject, Shape, ShapeNode, ShapePath, ShapePathStyle, SoftEdge, StrokeLinecap, StrokeLinejoin, Style, StyleObject, StyleUnit, TailEnd, Text, TextAlign, TextContent, TextDecoration, TextObject, TextOrientation, TextTransform, TextWrap, Uint32Color, VerticalAlign, Video, Visibility, WithNone, WithStyleNone, WritingMode, XyzColor, XyzaColor };
|
package/dist/index.d.mts
CHANGED
|
@@ -814,12 +814,12 @@ type EventListenerValue<T extends any[] = any[]> = (...args: T) => void;
|
|
|
814
814
|
type EventListenerOptions = boolean | {
|
|
815
815
|
once?: boolean;
|
|
816
816
|
};
|
|
817
|
-
interface EventListener
|
|
817
|
+
interface EventListener<T extends any[] = any[]> {
|
|
818
818
|
value: EventListenerValue<T>;
|
|
819
819
|
options?: EventListenerOptions;
|
|
820
820
|
}
|
|
821
821
|
declare class EventEmitter<T extends Record<string, any> = Record<string, any>> {
|
|
822
|
-
eventListeners: Map<keyof T, EventListener
|
|
822
|
+
eventListeners: Map<keyof T, EventListener<any[]> | EventListener<any[]>[]>;
|
|
823
823
|
addEventListener<K extends keyof T>(event: K, listener: EventListenerValue<T[K]>, options?: EventListenerOptions): this;
|
|
824
824
|
removeEventListener<K extends keyof T>(event: K, listener: EventListenerValue<T[K]>, options?: EventListenerOptions): this;
|
|
825
825
|
removeAllListeners(): this;
|
|
@@ -842,16 +842,15 @@ declare function setNestedValue(obj: any, path: (string | number)[], value: any)
|
|
|
842
842
|
declare function getObjectValueByPath(obj: any, path: string, fallback?: any): any;
|
|
843
843
|
declare function setObjectValueByPath(obj: any, path: string, value: any): void;
|
|
844
844
|
|
|
845
|
-
type EventListener = (...args: any[]) => void;
|
|
846
845
|
interface ObservableEvents {
|
|
847
|
-
[event: string]:
|
|
846
|
+
[event: string]: any[];
|
|
848
847
|
}
|
|
849
848
|
declare class Observable<T extends ObservableEvents = ObservableEvents> {
|
|
850
849
|
_observers: Map<string, Set<any>>;
|
|
851
|
-
on<K extends keyof T & string>(event: K, listener: T[K]): this;
|
|
852
|
-
once<K extends keyof T & string>(event: K, listener: T[K]): this;
|
|
853
|
-
off<K extends keyof T & string>(event: K, listener: T[K]): this;
|
|
854
|
-
emit<K extends keyof T & string>(event: K, ...args:
|
|
850
|
+
on<K extends keyof T & string>(event: K, listener: (...args: T[K]) => void): this;
|
|
851
|
+
once<K extends keyof T & string>(event: K, listener: (...args: T[K]) => void): this;
|
|
852
|
+
off<K extends keyof T & string>(event: K, listener: (...args: T[K]) => void): this;
|
|
853
|
+
emit<K extends keyof T & string>(event: K, ...args: T[K]): this;
|
|
855
854
|
destroy(): void;
|
|
856
855
|
}
|
|
857
856
|
|
|
@@ -865,13 +864,13 @@ declare class RawWeakMap<K extends WeakKey = WeakKey, V = any> {
|
|
|
865
864
|
}
|
|
866
865
|
|
|
867
866
|
interface ReactivableEvents extends ObservableEvents {
|
|
868
|
-
updateProperty:
|
|
867
|
+
updateProperty: [key: string, newValue: any, oldValue: any];
|
|
869
868
|
}
|
|
870
869
|
interface Reactivable {
|
|
871
|
-
on: <K extends keyof ReactivableEvents & string>(event: K, listener: ReactivableEvents[K]) => this;
|
|
872
|
-
once: <K extends keyof ReactivableEvents & string>(event: K, listener: ReactivableEvents[K]) => this;
|
|
873
|
-
off: <K extends keyof ReactivableEvents & string>(event: K, listener: ReactivableEvents[K]) => this;
|
|
874
|
-
emit: <K extends keyof ReactivableEvents & string>(event: K, ...args:
|
|
870
|
+
on: <K extends keyof ReactivableEvents & string>(event: K, listener: (...args: ReactivableEvents[K]) => void) => this;
|
|
871
|
+
once: <K extends keyof ReactivableEvents & string>(event: K, listener: (...args: ReactivableEvents[K]) => void) => this;
|
|
872
|
+
off: <K extends keyof ReactivableEvents & string>(event: K, listener: (...args: ReactivableEvents[K]) => void) => this;
|
|
873
|
+
emit: <K extends keyof ReactivableEvents & string>(event: K, ...args: ReactivableEvents[K]) => this;
|
|
875
874
|
}
|
|
876
875
|
declare class Reactivable extends Observable implements PropertyAccessor {
|
|
877
876
|
protected _propertyAccessor?: PropertyAccessor;
|
|
@@ -902,4 +901,4 @@ declare class Reactivable extends Observable implements PropertyAccessor {
|
|
|
902
901
|
}
|
|
903
902
|
|
|
904
903
|
export { EventEmitter, Observable, RawWeakMap, Reactivable, clearUndef, defaultColor, defineProperty, flatDocumentToDocument, getDeclarations, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultInnerShadow, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultOuterShadow, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, getNestedValue, getObjectValueByPath, getPropertyDescriptor, hasCRLF, idGenerator, isCRLF, isColor, isColorFill, isColorFillObject, isEqualObject, isFragmentObject, isGradient, isGradientFill, isGradientFillObject, isImageFill, isImageFillObject, isNone, isParagraphObject, isPresetFill, isPresetFillObject, nanoid, normalizeAudio, normalizeBackground, normalizeCRLF, normalizeColor, normalizeColorFill, normalizeDocument, normalizeEffect, normalizeElement, normalizeFill, normalizeFlatDocument, normalizeForeground, normalizeGradient, normalizeGradientFill, normalizeImageFill, normalizeInnerShadow, normalizeOuterShadow, normalizeOutline, normalizePresetFill, normalizeShadow, normalizeShape, normalizeSoftEdge, normalizeStyle, normalizeText, normalizeTextContent, normalizeVideo, parseColor, parseGradient, pick, property, property2, propertyOffsetDefaultValue, propertyOffsetGet, propertyOffsetSet, round, setNestedValue, setObjectValueByPath, stringifyGradient, textContentToString };
|
|
905
|
-
export type { Align, AngularNode, Audio, Background, BackgroundObject, BackgroundSize, BorderStyle, BoxShadow, BoxSizing, CmykColor, CmykaColor, Color, ColorFill, ColorFillObject, ColorStop, ColorStopNode, DefaultRadialNode, Direction, DirectionalNode, Display, Document, Effect, EffectObject, Element, EmNode, EventListenerOptions, EventListenerValue, ExtentKeywordNode, Fill, FillObject, FillRule, FlatDocument, FlatElement, FlatTextContent, FlexDirection, FlexWrap, FontKerning, FontStyle, FontWeight, Foreground, ForegroundObject, FragmentObject, FullStyle, GradientFill, GradientFillObject, GradientNode, HeadEnd, Hex8Color, HexNode, HighlightColormap, HighlightImage, HighlightLine, HighlightReferImage, HighlightSize, HighlightThickness, HslColor, HslaColor, HsvColor, HsvaColor, HwbColor, HwbaColor, IdGenerator, ImageFill, ImageFillCropRect, ImageFillObject, ImageFillStretchRect, ImageFillTile, InnerShadow, InnerShadowObject, Justify, LabColor, LabaColor, LchColor, LchaColor, LineCap, LineEndSize, LineEndType, LineJoin, LinearGradient, LinearGradientNode, LinearGradientWithType, ListStyleColormap, ListStyleImage, ListStylePosition, ListStyleSize, ListStyleType, LiteralNode, Meta, Node, None, NormalizedAudio, NormalizedBackground, NormalizedBaseBackground, NormalizedBaseForeground, NormalizedBaseOuterShadow, NormalizedBaseOutline, NormalizedColor, NormalizedColorFill, NormalizedDocument, NormalizedEffect, NormalizedElement, NormalizedElementStyle, NormalizedFill, NormalizedFlatDocument, NormalizedFlatElement, NormalizedForeground, NormalizedFragment, NormalizedGradientFill, NormalizedHighlight, NormalizedHighlightStyle, NormalizedImageFill, NormalizedInnerShadow, NormalizedLayoutStyle, NormalizedListStyle, NormalizedListStyleStyle, NormalizedOuterShadow, NormalizedOutline, NormalizedParagraph, NormalizedPresetFill, NormalizedShadow, NormalizedShadowStyle, NormalizedShape, NormalizedSoftEdge, NormalizedStyle, NormalizedText, NormalizedTextContent, NormalizedTextDrawStyle, NormalizedTextInlineStyle, NormalizedTextLineStyle, NormalizedTextStyle, NormalizedTransformStyle, NormalizedVideo, ObjectColor, ObservableEvents, OuterShadow, OuterShadowObject, Outline, OutlineObject, OutlineStyle, Overflow, ParagraphObject, PercentNode, PointerEvents, Position, PositionKeywordNode, PositionNode, PresetFill, PresetFillObject, PropertyAccessor, PropertyDeclaration, PxNode, RadialGradient, RadialGradientNode, RadialGradientWithType, ReactivableEvents, RepeatingLinearGradientNode, RepeatingRadialGradientNode, RgbColor, RgbNode, RgbaColor, RgbaNode, SVGPathData, Shadow, ShadowObject, Shape, ShapeNode, ShapePath, ShapePathStyle, SoftEdge, StrokeLinecap, StrokeLinejoin, Style, StyleObject, StyleUnit, TailEnd, Text, TextAlign, TextContent, TextDecoration, TextObject, TextOrientation, TextTransform, TextWrap, Uint32Color, VerticalAlign, Video, Visibility, WithNone, WithStyleNone, WritingMode, XyzColor, XyzaColor };
|
|
904
|
+
export type { Align, AngularNode, Audio, Background, BackgroundObject, BackgroundSize, BorderStyle, BoxShadow, BoxSizing, CmykColor, CmykaColor, Color, ColorFill, ColorFillObject, ColorStop, ColorStopNode, DefaultRadialNode, Direction, DirectionalNode, Display, Document, Effect, EffectObject, Element, EmNode, EventListener, EventListenerOptions, EventListenerValue, ExtentKeywordNode, Fill, FillObject, FillRule, FlatDocument, FlatElement, FlatTextContent, FlexDirection, FlexWrap, FontKerning, FontStyle, FontWeight, Foreground, ForegroundObject, FragmentObject, FullStyle, GradientFill, GradientFillObject, GradientNode, HeadEnd, Hex8Color, HexNode, HighlightColormap, HighlightImage, HighlightLine, HighlightReferImage, HighlightSize, HighlightThickness, HslColor, HslaColor, HsvColor, HsvaColor, HwbColor, HwbaColor, IdGenerator, ImageFill, ImageFillCropRect, ImageFillObject, ImageFillStretchRect, ImageFillTile, InnerShadow, InnerShadowObject, Justify, LabColor, LabaColor, LchColor, LchaColor, LineCap, LineEndSize, LineEndType, LineJoin, LinearGradient, LinearGradientNode, LinearGradientWithType, ListStyleColormap, ListStyleImage, ListStylePosition, ListStyleSize, ListStyleType, LiteralNode, Meta, Node, None, NormalizedAudio, NormalizedBackground, NormalizedBaseBackground, NormalizedBaseForeground, NormalizedBaseOuterShadow, NormalizedBaseOutline, NormalizedColor, NormalizedColorFill, NormalizedDocument, NormalizedEffect, NormalizedElement, NormalizedElementStyle, NormalizedFill, NormalizedFlatDocument, NormalizedFlatElement, NormalizedForeground, NormalizedFragment, NormalizedGradientFill, NormalizedHighlight, NormalizedHighlightStyle, NormalizedImageFill, NormalizedInnerShadow, NormalizedLayoutStyle, NormalizedListStyle, NormalizedListStyleStyle, NormalizedOuterShadow, NormalizedOutline, NormalizedParagraph, NormalizedPresetFill, NormalizedShadow, NormalizedShadowStyle, NormalizedShape, NormalizedSoftEdge, NormalizedStyle, NormalizedText, NormalizedTextContent, NormalizedTextDrawStyle, NormalizedTextInlineStyle, NormalizedTextLineStyle, NormalizedTextStyle, NormalizedTransformStyle, NormalizedVideo, ObjectColor, ObservableEvents, OuterShadow, OuterShadowObject, Outline, OutlineObject, OutlineStyle, Overflow, ParagraphObject, PercentNode, PointerEvents, Position, PositionKeywordNode, PositionNode, PresetFill, PresetFillObject, PropertyAccessor, PropertyDeclaration, PxNode, RadialGradient, RadialGradientNode, RadialGradientWithType, ReactivableEvents, RepeatingLinearGradientNode, RepeatingRadialGradientNode, RgbColor, RgbNode, RgbaColor, RgbaNode, SVGPathData, Shadow, ShadowObject, Shape, ShapeNode, ShapePath, ShapePathStyle, SoftEdge, StrokeLinecap, StrokeLinejoin, Style, StyleObject, StyleUnit, TailEnd, Text, TextAlign, TextContent, TextDecoration, TextObject, TextOrientation, TextTransform, TextWrap, Uint32Color, VerticalAlign, Video, Visibility, WithNone, WithStyleNone, WritingMode, XyzColor, XyzaColor };
|
package/dist/index.d.ts
CHANGED
|
@@ -814,12 +814,12 @@ type EventListenerValue<T extends any[] = any[]> = (...args: T) => void;
|
|
|
814
814
|
type EventListenerOptions = boolean | {
|
|
815
815
|
once?: boolean;
|
|
816
816
|
};
|
|
817
|
-
interface EventListener
|
|
817
|
+
interface EventListener<T extends any[] = any[]> {
|
|
818
818
|
value: EventListenerValue<T>;
|
|
819
819
|
options?: EventListenerOptions;
|
|
820
820
|
}
|
|
821
821
|
declare class EventEmitter<T extends Record<string, any> = Record<string, any>> {
|
|
822
|
-
eventListeners: Map<keyof T, EventListener
|
|
822
|
+
eventListeners: Map<keyof T, EventListener<any[]> | EventListener<any[]>[]>;
|
|
823
823
|
addEventListener<K extends keyof T>(event: K, listener: EventListenerValue<T[K]>, options?: EventListenerOptions): this;
|
|
824
824
|
removeEventListener<K extends keyof T>(event: K, listener: EventListenerValue<T[K]>, options?: EventListenerOptions): this;
|
|
825
825
|
removeAllListeners(): this;
|
|
@@ -842,16 +842,15 @@ declare function setNestedValue(obj: any, path: (string | number)[], value: any)
|
|
|
842
842
|
declare function getObjectValueByPath(obj: any, path: string, fallback?: any): any;
|
|
843
843
|
declare function setObjectValueByPath(obj: any, path: string, value: any): void;
|
|
844
844
|
|
|
845
|
-
type EventListener = (...args: any[]) => void;
|
|
846
845
|
interface ObservableEvents {
|
|
847
|
-
[event: string]:
|
|
846
|
+
[event: string]: any[];
|
|
848
847
|
}
|
|
849
848
|
declare class Observable<T extends ObservableEvents = ObservableEvents> {
|
|
850
849
|
_observers: Map<string, Set<any>>;
|
|
851
|
-
on<K extends keyof T & string>(event: K, listener: T[K]): this;
|
|
852
|
-
once<K extends keyof T & string>(event: K, listener: T[K]): this;
|
|
853
|
-
off<K extends keyof T & string>(event: K, listener: T[K]): this;
|
|
854
|
-
emit<K extends keyof T & string>(event: K, ...args:
|
|
850
|
+
on<K extends keyof T & string>(event: K, listener: (...args: T[K]) => void): this;
|
|
851
|
+
once<K extends keyof T & string>(event: K, listener: (...args: T[K]) => void): this;
|
|
852
|
+
off<K extends keyof T & string>(event: K, listener: (...args: T[K]) => void): this;
|
|
853
|
+
emit<K extends keyof T & string>(event: K, ...args: T[K]): this;
|
|
855
854
|
destroy(): void;
|
|
856
855
|
}
|
|
857
856
|
|
|
@@ -865,13 +864,13 @@ declare class RawWeakMap<K extends WeakKey = WeakKey, V = any> {
|
|
|
865
864
|
}
|
|
866
865
|
|
|
867
866
|
interface ReactivableEvents extends ObservableEvents {
|
|
868
|
-
updateProperty:
|
|
867
|
+
updateProperty: [key: string, newValue: any, oldValue: any];
|
|
869
868
|
}
|
|
870
869
|
interface Reactivable {
|
|
871
|
-
on: <K extends keyof ReactivableEvents & string>(event: K, listener: ReactivableEvents[K]) => this;
|
|
872
|
-
once: <K extends keyof ReactivableEvents & string>(event: K, listener: ReactivableEvents[K]) => this;
|
|
873
|
-
off: <K extends keyof ReactivableEvents & string>(event: K, listener: ReactivableEvents[K]) => this;
|
|
874
|
-
emit: <K extends keyof ReactivableEvents & string>(event: K, ...args:
|
|
870
|
+
on: <K extends keyof ReactivableEvents & string>(event: K, listener: (...args: ReactivableEvents[K]) => void) => this;
|
|
871
|
+
once: <K extends keyof ReactivableEvents & string>(event: K, listener: (...args: ReactivableEvents[K]) => void) => this;
|
|
872
|
+
off: <K extends keyof ReactivableEvents & string>(event: K, listener: (...args: ReactivableEvents[K]) => void) => this;
|
|
873
|
+
emit: <K extends keyof ReactivableEvents & string>(event: K, ...args: ReactivableEvents[K]) => this;
|
|
875
874
|
}
|
|
876
875
|
declare class Reactivable extends Observable implements PropertyAccessor {
|
|
877
876
|
protected _propertyAccessor?: PropertyAccessor;
|
|
@@ -902,4 +901,4 @@ declare class Reactivable extends Observable implements PropertyAccessor {
|
|
|
902
901
|
}
|
|
903
902
|
|
|
904
903
|
export { EventEmitter, Observable, RawWeakMap, Reactivable, clearUndef, defaultColor, defineProperty, flatDocumentToDocument, getDeclarations, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultInnerShadow, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultOuterShadow, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, getNestedValue, getObjectValueByPath, getPropertyDescriptor, hasCRLF, idGenerator, isCRLF, isColor, isColorFill, isColorFillObject, isEqualObject, isFragmentObject, isGradient, isGradientFill, isGradientFillObject, isImageFill, isImageFillObject, isNone, isParagraphObject, isPresetFill, isPresetFillObject, nanoid, normalizeAudio, normalizeBackground, normalizeCRLF, normalizeColor, normalizeColorFill, normalizeDocument, normalizeEffect, normalizeElement, normalizeFill, normalizeFlatDocument, normalizeForeground, normalizeGradient, normalizeGradientFill, normalizeImageFill, normalizeInnerShadow, normalizeOuterShadow, normalizeOutline, normalizePresetFill, normalizeShadow, normalizeShape, normalizeSoftEdge, normalizeStyle, normalizeText, normalizeTextContent, normalizeVideo, parseColor, parseGradient, pick, property, property2, propertyOffsetDefaultValue, propertyOffsetGet, propertyOffsetSet, round, setNestedValue, setObjectValueByPath, stringifyGradient, textContentToString };
|
|
905
|
-
export type { Align, AngularNode, Audio, Background, BackgroundObject, BackgroundSize, BorderStyle, BoxShadow, BoxSizing, CmykColor, CmykaColor, Color, ColorFill, ColorFillObject, ColorStop, ColorStopNode, DefaultRadialNode, Direction, DirectionalNode, Display, Document, Effect, EffectObject, Element, EmNode, EventListenerOptions, EventListenerValue, ExtentKeywordNode, Fill, FillObject, FillRule, FlatDocument, FlatElement, FlatTextContent, FlexDirection, FlexWrap, FontKerning, FontStyle, FontWeight, Foreground, ForegroundObject, FragmentObject, FullStyle, GradientFill, GradientFillObject, GradientNode, HeadEnd, Hex8Color, HexNode, HighlightColormap, HighlightImage, HighlightLine, HighlightReferImage, HighlightSize, HighlightThickness, HslColor, HslaColor, HsvColor, HsvaColor, HwbColor, HwbaColor, IdGenerator, ImageFill, ImageFillCropRect, ImageFillObject, ImageFillStretchRect, ImageFillTile, InnerShadow, InnerShadowObject, Justify, LabColor, LabaColor, LchColor, LchaColor, LineCap, LineEndSize, LineEndType, LineJoin, LinearGradient, LinearGradientNode, LinearGradientWithType, ListStyleColormap, ListStyleImage, ListStylePosition, ListStyleSize, ListStyleType, LiteralNode, Meta, Node, None, NormalizedAudio, NormalizedBackground, NormalizedBaseBackground, NormalizedBaseForeground, NormalizedBaseOuterShadow, NormalizedBaseOutline, NormalizedColor, NormalizedColorFill, NormalizedDocument, NormalizedEffect, NormalizedElement, NormalizedElementStyle, NormalizedFill, NormalizedFlatDocument, NormalizedFlatElement, NormalizedForeground, NormalizedFragment, NormalizedGradientFill, NormalizedHighlight, NormalizedHighlightStyle, NormalizedImageFill, NormalizedInnerShadow, NormalizedLayoutStyle, NormalizedListStyle, NormalizedListStyleStyle, NormalizedOuterShadow, NormalizedOutline, NormalizedParagraph, NormalizedPresetFill, NormalizedShadow, NormalizedShadowStyle, NormalizedShape, NormalizedSoftEdge, NormalizedStyle, NormalizedText, NormalizedTextContent, NormalizedTextDrawStyle, NormalizedTextInlineStyle, NormalizedTextLineStyle, NormalizedTextStyle, NormalizedTransformStyle, NormalizedVideo, ObjectColor, ObservableEvents, OuterShadow, OuterShadowObject, Outline, OutlineObject, OutlineStyle, Overflow, ParagraphObject, PercentNode, PointerEvents, Position, PositionKeywordNode, PositionNode, PresetFill, PresetFillObject, PropertyAccessor, PropertyDeclaration, PxNode, RadialGradient, RadialGradientNode, RadialGradientWithType, ReactivableEvents, RepeatingLinearGradientNode, RepeatingRadialGradientNode, RgbColor, RgbNode, RgbaColor, RgbaNode, SVGPathData, Shadow, ShadowObject, Shape, ShapeNode, ShapePath, ShapePathStyle, SoftEdge, StrokeLinecap, StrokeLinejoin, Style, StyleObject, StyleUnit, TailEnd, Text, TextAlign, TextContent, TextDecoration, TextObject, TextOrientation, TextTransform, TextWrap, Uint32Color, VerticalAlign, Video, Visibility, WithNone, WithStyleNone, WritingMode, XyzColor, XyzaColor };
|
|
904
|
+
export type { Align, AngularNode, Audio, Background, BackgroundObject, BackgroundSize, BorderStyle, BoxShadow, BoxSizing, CmykColor, CmykaColor, Color, ColorFill, ColorFillObject, ColorStop, ColorStopNode, DefaultRadialNode, Direction, DirectionalNode, Display, Document, Effect, EffectObject, Element, EmNode, EventListener, EventListenerOptions, EventListenerValue, ExtentKeywordNode, Fill, FillObject, FillRule, FlatDocument, FlatElement, FlatTextContent, FlexDirection, FlexWrap, FontKerning, FontStyle, FontWeight, Foreground, ForegroundObject, FragmentObject, FullStyle, GradientFill, GradientFillObject, GradientNode, HeadEnd, Hex8Color, HexNode, HighlightColormap, HighlightImage, HighlightLine, HighlightReferImage, HighlightSize, HighlightThickness, HslColor, HslaColor, HsvColor, HsvaColor, HwbColor, HwbaColor, IdGenerator, ImageFill, ImageFillCropRect, ImageFillObject, ImageFillStretchRect, ImageFillTile, InnerShadow, InnerShadowObject, Justify, LabColor, LabaColor, LchColor, LchaColor, LineCap, LineEndSize, LineEndType, LineJoin, LinearGradient, LinearGradientNode, LinearGradientWithType, ListStyleColormap, ListStyleImage, ListStylePosition, ListStyleSize, ListStyleType, LiteralNode, Meta, Node, None, NormalizedAudio, NormalizedBackground, NormalizedBaseBackground, NormalizedBaseForeground, NormalizedBaseOuterShadow, NormalizedBaseOutline, NormalizedColor, NormalizedColorFill, NormalizedDocument, NormalizedEffect, NormalizedElement, NormalizedElementStyle, NormalizedFill, NormalizedFlatDocument, NormalizedFlatElement, NormalizedForeground, NormalizedFragment, NormalizedGradientFill, NormalizedHighlight, NormalizedHighlightStyle, NormalizedImageFill, NormalizedInnerShadow, NormalizedLayoutStyle, NormalizedListStyle, NormalizedListStyleStyle, NormalizedOuterShadow, NormalizedOutline, NormalizedParagraph, NormalizedPresetFill, NormalizedShadow, NormalizedShadowStyle, NormalizedShape, NormalizedSoftEdge, NormalizedStyle, NormalizedText, NormalizedTextContent, NormalizedTextDrawStyle, NormalizedTextInlineStyle, NormalizedTextLineStyle, NormalizedTextStyle, NormalizedTransformStyle, NormalizedVideo, ObjectColor, ObservableEvents, OuterShadow, OuterShadowObject, Outline, OutlineObject, OutlineStyle, Overflow, ParagraphObject, PercentNode, PointerEvents, Position, PositionKeywordNode, PositionNode, PresetFill, PresetFillObject, PropertyAccessor, PropertyDeclaration, PxNode, RadialGradient, RadialGradientNode, RadialGradientWithType, ReactivableEvents, RepeatingLinearGradientNode, RepeatingRadialGradientNode, RgbColor, RgbNode, RgbaColor, RgbaNode, SVGPathData, Shadow, ShadowObject, Shape, ShapeNode, ShapePath, ShapePathStyle, SoftEdge, StrokeLinecap, StrokeLinejoin, Style, StyleObject, StyleUnit, TailEnd, Text, TextAlign, TextContent, TextDecoration, TextObject, TextOrientation, TextTransform, TextWrap, Uint32Color, VerticalAlign, Video, Visibility, WithNone, WithStyleNone, WritingMode, XyzColor, XyzaColor };
|