@dooboostore/simple-web-component 1.0.48 → 1.0.50
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/README.md +189 -19
- package/dist/cjs/config/config.js +1 -1
- package/dist/cjs/config/config.js.map +2 -2
- package/dist/cjs/decorators/addEventListener.js +2373 -30
- package/dist/cjs/decorators/addEventListener.js.map +3 -3
- package/dist/cjs/decorators/applyAttribute.js +31 -0
- package/dist/cjs/decorators/applyAttribute.js.map +2 -2
- package/dist/cjs/decorators/applyClass.js +55 -18
- package/dist/cjs/decorators/applyClass.js.map +3 -3
- package/dist/cjs/decorators/applyNode.js +73 -1
- package/dist/cjs/decorators/applyNode.js.map +3 -3
- package/dist/cjs/decorators/applyProperty.js +107 -3
- package/dist/cjs/decorators/applyProperty.js.map +2 -2
- package/dist/cjs/decorators/applySlot.js +6 -5
- package/dist/cjs/decorators/applySlot.js.map +2 -2
- package/dist/cjs/decorators/applyStyle.js +42 -5
- package/dist/cjs/decorators/applyStyle.js.map +2 -2
- package/dist/cjs/decorators/changedAttribute.js +61 -13
- package/dist/cjs/decorators/changedAttribute.js.map +2 -2
- package/dist/cjs/decorators/elementDefine.js +254 -439
- package/dist/cjs/decorators/elementDefine.js.map +3 -3
- package/dist/cjs/decorators/emitCustomEvent.js +55 -0
- package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
- package/dist/cjs/decorators/eventMedia.js +84 -0
- package/dist/cjs/decorators/eventMedia.js.map +7 -0
- package/dist/cjs/decorators/index.js +6 -1
- package/dist/cjs/decorators/index.js.map +2 -2
- package/dist/cjs/decorators/intersectionObserver.js +200 -0
- package/dist/cjs/decorators/intersectionObserver.js.map +7 -0
- package/dist/cjs/decorators/mutationObserver.js +186 -55
- package/dist/cjs/decorators/mutationObserver.js.map +3 -3
- package/dist/cjs/decorators/parameter.js +73 -0
- package/dist/cjs/decorators/parameter.js.map +7 -0
- package/dist/cjs/decorators/query.js +117 -102
- package/dist/cjs/decorators/query.js.map +2 -2
- package/dist/cjs/decorators/requestAnimationFrame.js +124 -0
- package/dist/cjs/decorators/requestAnimationFrame.js.map +7 -0
- package/dist/cjs/decorators/resizeObserver.js +133 -55
- package/dist/cjs/decorators/resizeObserver.js.map +2 -2
- package/dist/cjs/decorators/setInterval.js +114 -0
- package/dist/cjs/decorators/setInterval.js.map +7 -0
- package/dist/cjs/decorators/setTimeout.js +117 -0
- package/dist/cjs/decorators/setTimeout.js.map +7 -0
- package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js +9 -0
- package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js.map +2 -2
- package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js +9 -0
- package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
- package/dist/cjs/elements/SwcAppMixin.js +19 -3
- package/dist/cjs/elements/SwcAppMixin.js.map +2 -2
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/types/window.d.js.map +1 -1
- package/dist/esm/config/config.js +1 -1
- package/dist/esm/config/config.js.map +2 -2
- package/dist/esm/decorators/addEventListener.js +2374 -30
- package/dist/esm/decorators/addEventListener.js.map +3 -3
- package/dist/esm/decorators/applyAttribute.js +31 -0
- package/dist/esm/decorators/applyAttribute.js.map +2 -2
- package/dist/esm/decorators/applyClass.js +55 -18
- package/dist/esm/decorators/applyClass.js.map +3 -3
- package/dist/esm/decorators/applyNode.js +73 -1
- package/dist/esm/decorators/applyNode.js.map +3 -3
- package/dist/esm/decorators/applyProperty.js +107 -3
- package/dist/esm/decorators/applyProperty.js.map +2 -2
- package/dist/esm/decorators/applySlot.js +6 -5
- package/dist/esm/decorators/applySlot.js.map +2 -2
- package/dist/esm/decorators/applyStyle.js +42 -5
- package/dist/esm/decorators/applyStyle.js.map +2 -2
- package/dist/esm/decorators/changedAttribute.js +62 -13
- package/dist/esm/decorators/changedAttribute.js.map +2 -2
- package/dist/esm/decorators/elementDefine.js +261 -446
- package/dist/esm/decorators/elementDefine.js.map +3 -3
- package/dist/esm/decorators/emitCustomEvent.js +55 -0
- package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
- package/dist/esm/decorators/eventMedia.js +66 -0
- package/dist/esm/decorators/eventMedia.js.map +7 -0
- package/dist/esm/decorators/index.js +6 -1
- package/dist/esm/decorators/index.js.map +2 -2
- package/dist/esm/decorators/intersectionObserver.js +182 -0
- package/dist/esm/decorators/intersectionObserver.js.map +7 -0
- package/dist/esm/decorators/mutationObserver.js +187 -55
- package/dist/esm/decorators/mutationObserver.js.map +3 -3
- package/dist/esm/decorators/parameter.js +54 -0
- package/dist/esm/decorators/parameter.js.map +7 -0
- package/dist/esm/decorators/query.js +117 -102
- package/dist/esm/decorators/query.js.map +2 -2
- package/dist/esm/decorators/requestAnimationFrame.js +105 -0
- package/dist/esm/decorators/requestAnimationFrame.js.map +7 -0
- package/dist/esm/decorators/resizeObserver.js +134 -55
- package/dist/esm/decorators/resizeObserver.js.map +2 -2
- package/dist/esm/decorators/setInterval.js +95 -0
- package/dist/esm/decorators/setInterval.js.map +7 -0
- package/dist/esm/decorators/setTimeout.js +98 -0
- package/dist/esm/decorators/setTimeout.js.map +7 -0
- package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js +9 -0
- package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js.map +2 -2
- package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js +9 -0
- package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
- package/dist/esm/elements/SwcAppMixin.js +20 -4
- package/dist/esm/elements/SwcAppMixin.js.map +2 -2
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +4961 -1628
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
- package/dist/types/config/config.d.ts.map +1 -1
- package/dist/types/decorators/addEventListener.d.ts +1046 -33
- package/dist/types/decorators/addEventListener.d.ts.map +1 -1
- package/dist/types/decorators/applyAttribute.d.ts +24 -34
- package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
- package/dist/types/decorators/applyClass.d.ts +36 -34
- package/dist/types/decorators/applyClass.d.ts.map +1 -1
- package/dist/types/decorators/applyNode.d.ts +32 -20
- package/dist/types/decorators/applyNode.d.ts.map +1 -1
- package/dist/types/decorators/applyProperty.d.ts +61 -34
- package/dist/types/decorators/applyProperty.d.ts.map +1 -1
- package/dist/types/decorators/applySlot.d.ts.map +1 -1
- package/dist/types/decorators/applyStyle.d.ts +27 -12
- package/dist/types/decorators/applyStyle.d.ts.map +1 -1
- package/dist/types/decorators/changedAttribute.d.ts +12 -3
- package/dist/types/decorators/changedAttribute.d.ts.map +1 -1
- package/dist/types/decorators/elementDefine.d.ts +0 -14
- package/dist/types/decorators/elementDefine.d.ts.map +1 -1
- package/dist/types/decorators/emitCustomEvent.d.ts +28 -4
- package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
- package/dist/types/decorators/eventMedia.d.ts +25 -0
- package/dist/types/decorators/eventMedia.d.ts.map +1 -0
- package/dist/types/decorators/index.d.ts +6 -1
- package/dist/types/decorators/index.d.ts.map +1 -1
- package/dist/types/decorators/intersectionObserver.d.ts +58 -0
- package/dist/types/decorators/intersectionObserver.d.ts.map +1 -0
- package/dist/types/decorators/mutationObserver.d.ts +44 -25
- package/dist/types/decorators/mutationObserver.d.ts.map +1 -1
- package/dist/types/decorators/parameter.d.ts +35 -0
- package/dist/types/decorators/parameter.d.ts.map +1 -0
- package/dist/types/decorators/query.d.ts +57 -14
- package/dist/types/decorators/query.d.ts.map +1 -1
- package/dist/types/decorators/requestAnimationFrame.d.ts +47 -0
- package/dist/types/decorators/requestAnimationFrame.d.ts.map +1 -0
- package/dist/types/decorators/resizeObserver.d.ts +43 -23
- package/dist/types/decorators/resizeObserver.d.ts.map +1 -1
- package/dist/types/decorators/setInterval.d.ts +41 -0
- package/dist/types/decorators/setInterval.d.ts.map +1 -0
- package/dist/types/decorators/setTimeout.d.ts +41 -0
- package/dist/types/decorators/setTimeout.d.ts.map +1 -0
- package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts +7 -1
- package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts.map +1 -1
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts +6 -0
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts.map +1 -1
- package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +104 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +4961 -1628
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
- package/package.json +7 -5
- package/src/config/config.ts +1 -1
- package/src/decorators/addEventListener.ts +1446 -34
- package/src/decorators/applyAttribute.ts +60 -36
- package/src/decorators/applyClass.ts +86 -26
- package/src/decorators/applyNode.ts +124 -36
- package/src/decorators/applyProperty.ts +172 -40
- package/src/decorators/applySlot.ts +6 -5
- package/src/decorators/applyStyle.ts +74 -17
- package/src/decorators/changedAttribute.ts +76 -15
- package/src/decorators/elementDefine.ts +310 -582
- package/src/decorators/emitCustomEvent.ts +73 -5
- package/src/decorators/eventMedia.ts +78 -0
- package/src/decorators/index.ts +6 -1
- package/src/decorators/intersectionObserver.ts +275 -0
- package/src/decorators/mutationObserver.ts +282 -89
- package/src/decorators/parameter.ts +81 -0
- package/src/decorators/query.ts +168 -126
- package/src/decorators/requestAnimationFrame.ts +158 -0
- package/src/decorators/resizeObserver.ts +211 -89
- package/src/decorators/setInterval.ts +136 -0
- package/src/decorators/setTimeout.ts +139 -0
- package/src/decorators/subscribeSwcAppMessageWhileConnected.ts +17 -0
- package/src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts +19 -0
- package/src/elements/SwcAppMixin.ts +20 -5
- package/src/types/index.ts +141 -0
- package/src/types/window.d.ts +2 -18
- package/dist/cjs/decorators/queryAll.js +0 -181
- package/dist/cjs/decorators/queryAll.js.map +0 -7
- package/dist/cjs/examples/RxJSOperatorsExample.js +0 -285
- package/dist/cjs/examples/RxJSOperatorsExample.js.map +0 -7
- package/dist/esm/decorators/queryAll.js +0 -162
- package/dist/esm/decorators/queryAll.js.map +0 -7
- package/dist/esm/examples/RxJSOperatorsExample.js +0 -266
- package/dist/esm/examples/RxJSOperatorsExample.js.map +0 -7
- package/dist/types/decorators/queryAll.d.ts +0 -22
- package/dist/types/decorators/queryAll.d.ts.map +0 -1
- package/dist/types/examples/RxJSOperatorsExample.d.ts +0 -94
- package/dist/types/examples/RxJSOperatorsExample.d.ts.map +0 -1
- package/src/decorators/queryAll.ts +0 -186
- package/src/examples/RxJSOperatorsExample.ts +0 -279
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutationObserver.d.ts","sourceRoot":"","sources":["../../../src/decorators/mutationObserver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"mutationObserver.d.ts","sourceRoot":"","sources":["../../../src/decorators/mutationObserver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGvG,MAAM,WAAW,2BAA4B,SAAQ,oBAAoB;IACvE,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE;QAAE,WAAW,EAAE,GAAG,CAAC;QAAC,MAAM,EAAE,aAAa,CAAA;KAAE,KAAK,OAAO,CAAC;IAEnG,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,4BAA4B,KAAK,IAAI,CAAC;CACvF;AAGD,MAAM,MAAM,4BAA4B,GAAG,2BAA2B,GAAG,eAAe,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAElH,MAAM,M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+1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @eventObject/@matchedElement/@hostSet/@helperHostSet/@helperSet/@routerEvent/@appMessage —
|
|
3
|
+
* @addEventListener/lifecycle/subscribeSwcAppRouteChangeWhileConnected/subscribeSwcAppMessageWhileConnected
|
|
4
|
+
* 계열 핸들러의 파라미터를 순서 무관하게 선언할 수 있게 해주는 파라미터 데코레이터.
|
|
5
|
+
* @dooboostore/simple-boot의 @Inject와 동일한 인덱스 기반 메타데이터 패턴을 따른다:
|
|
6
|
+
* 데코레이터가 실행되는 순서가 아니라 실제 parameterIndex로 슬롯을 매칭하므로,
|
|
7
|
+
* 사용자가 파라미터 선언 순서를 자유롭게 바꿔도 된다.
|
|
8
|
+
*/
|
|
9
|
+
export type SwcParamKind = 'event' | 'matched' | 'hostSet' | 'helperHostSet' | 'helperSet' | 'routerEvent' | 'appMessage';
|
|
10
|
+
type SaveParamConfig = {
|
|
11
|
+
index: number;
|
|
12
|
+
kind: SwcParamKind;
|
|
13
|
+
};
|
|
14
|
+
/** 이벤트 핸들러의 원본 Event 객체를 주입한다. */
|
|
15
|
+
export declare function eventObject(target: Object, propertyKey: string | symbol, parameterIndex: number): void;
|
|
16
|
+
/** delegate로 매칭된 실제 엘리먼트($matchedElement)를 주입한다. */
|
|
17
|
+
export declare function matchedElement(target: Object, propertyKey: string | symbol, parameterIndex: number): void;
|
|
18
|
+
/** HostSet(호스트 트리 정보 — $host/$hosts/$firstHost/$appHost 등)을 주입한다. */
|
|
19
|
+
export declare function hostSet(target: Object, propertyKey: string | symbol, parameterIndex: number): void;
|
|
20
|
+
/** HelperHostSet(HelperSet + HostSet + $this 전체 묶음)을 주입한다. */
|
|
21
|
+
export declare function helperHostSet(target: Object, propertyKey: string | symbol, parameterIndex: number): void;
|
|
22
|
+
/** HelperSet($d/$w/$q/$qa/$qi 등 순수 DOM/window 헬퍼, 호스트 트리 정보 없음)을 주입한다. */
|
|
23
|
+
export declare function helperSet(target: Object, propertyKey: string | symbol, parameterIndex: number): void;
|
|
24
|
+
/** @subscribeSwcAppRouteChangeWhileConnected 핸들러의 라우트 변경 이벤트({...RouterEventType, pathData})를 주입한다. */
|
|
25
|
+
export declare function routerEvent(target: Object, propertyKey: string | symbol, parameterIndex: number): void;
|
|
26
|
+
/** @subscribeSwcAppMessageWhileConnected 핸들러의 SwcAppMessage 페이로드를 주입한다. */
|
|
27
|
+
export declare function appMessage(target: Object, propertyKey: string | symbol, parameterIndex: number): void;
|
|
28
|
+
export declare const getParameterMetadata: (target: any, propertyKey: string | symbol) => SaveParamConfig[];
|
|
29
|
+
/**
|
|
30
|
+
* 위 파라미터 데코레이터 메타데이터가 하나라도 있으면 kind별 값을 index 순서에 맞게
|
|
31
|
+
* 배열로 조립하고, 하나도 없으면 기존 위치 인자(legacyArgs)를 그대로 반환한다 — 완전 하위호환.
|
|
32
|
+
*/
|
|
33
|
+
export declare const buildSwcParameterArgs: (target: any, propertyKey: string | symbol, kindValues: Partial<Record<SwcParamKind, any>>, legacyArgs: any[]) => any[];
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=parameter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameter.d.ts","sourceRoot":"","sources":["../../../src/decorators/parameter.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,eAAe,GAAG,WAAW,GAAG,aAAa,GAAG,YAAY,CAAC;AAI1H,KAAK,eAAe,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC;AAU7D,kCAAkC;AAClC,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI,CAEtG;AAED,oDAAoD;AACpD,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,E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|
+
import { SwcQueryOptions, SwcRootType, SwcFnSelector, SwcSelector, HelperHostSet } from '../types';
|
|
2
|
+
export type QueryPick = 'first' | 'last' | 'all' | 'even' | 'odd' | number;
|
|
3
|
+
export interface QueryBaseOptions {
|
|
4
|
+
pick?: QueryPick;
|
|
7
5
|
filter?: (target: HTMLElement, meta: {
|
|
8
6
|
currentThis: any;
|
|
9
7
|
helper: HelperHostSet;
|
|
10
8
|
}) => boolean;
|
|
11
9
|
}
|
|
10
|
+
export type QueryOptions = QueryBaseOptions & SwcQueryOptions;
|
|
11
|
+
export type QueryNonQueryOptions = QueryBaseOptions;
|
|
12
|
+
export type QueryFnSelector = SwcFnSelector;
|
|
13
|
+
export type QuerySelector = SwcSelector;
|
|
14
|
+
export type QueryOptionsOf<S extends QuerySelector> = S extends string ? QueryOptions : QueryNonQueryOptions;
|
|
12
15
|
export interface QueryMetadata {
|
|
13
16
|
propertyKey: string | symbol;
|
|
14
|
-
selector:
|
|
17
|
+
selector: QuerySelector;
|
|
15
18
|
options: QueryOptions;
|
|
16
19
|
}
|
|
17
20
|
export declare const QUERY_METADATA_KEY: unique symbol;
|
|
21
|
+
/**
|
|
22
|
+
* 셀렉터를 해석해 매칭된 모든 요소를 배열로 반환한다 (query/queryAll 공용).
|
|
23
|
+
* $window/$document는 요소가 아니므로 여기서 처리하지 않는다.
|
|
24
|
+
*/
|
|
25
|
+
export declare const resolveQueryElements: (inst: any, selector: QuerySelector, options: QueryOptions, win: Window) => HTMLElement[];
|
|
26
|
+
/**
|
|
27
|
+
* 매칭된 요소 배열에서 pick 옵션에 따라 요소를 고른다.
|
|
28
|
+
* - 'first'(기본) / 'last' / number(인덱스) → 단일 요소
|
|
29
|
+
* - 'all' / 'even'(0,2,4...) / 'odd'(1,3,5...) → 배열
|
|
30
|
+
*/
|
|
31
|
+
export declare const pickElements: (all: HTMLElement[], pick: QueryPick) => HTMLElement | HTMLElement[] | null;
|
|
18
32
|
export declare function query(target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor): PropertyDescriptor | void;
|
|
19
|
-
export declare function query(selector: string
|
|
33
|
+
export declare function query(selector: string, options?: QueryOptions): PropertyDecorator;
|
|
34
|
+
export declare function query(selector: QueryFnSelector, options?: QueryNonQueryOptions): PropertyDecorator;
|
|
20
35
|
export declare function query(options?: QueryOptions): PropertyDecorator;
|
|
21
36
|
export declare const getQueryMetadata: (target: any) => QueryMetadata[];
|
|
37
|
+
export declare const QUERY_ALL_METADATA_KEY: symbol;
|
|
38
|
+
export declare function queryAll(target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor): PropertyDescriptor | void;
|
|
39
|
+
export declare function queryAll(selector: string, options?: Omit<QueryOptions, 'pick'>): PropertyDecorator;
|
|
40
|
+
export declare function queryAll(selector: QueryFnSelector, options?: Omit<QueryNonQueryOptions, 'pick'>): PropertyDecorator;
|
|
41
|
+
export declare function queryAll(options?: Omit<QueryOptions, 'pick'>): PropertyDecorator;
|
|
42
|
+
export declare const getQueryAllMetadata: (target: any) => QueryMetadata[];
|
|
43
|
+
/**
|
|
44
|
+
* @queryShadow(selector, options?) — shadow DOM에서 요소를 쿼리
|
|
45
|
+
*/
|
|
46
|
+
export declare function queryShadow(selector: string | QueryFnSelector, options?: QueryBaseOptions): PropertyDecorator;
|
|
47
|
+
/**
|
|
48
|
+
* @queryLight(selector, options?) — light DOM에서 요소를 쿼리
|
|
49
|
+
*/
|
|
50
|
+
export declare function queryLight(selector: string | QueryFnSelector, options?: QueryBaseOptions): PropertyDecorator;
|
|
51
|
+
/**
|
|
52
|
+
* @queryAllRoots(selector, options?) — shadow+light 모두에서 요소를 쿼리 (pick 기본 first)
|
|
53
|
+
*/
|
|
54
|
+
export declare function queryAllRoots(selector: string | QueryFnSelector, options?: QueryBaseOptions): PropertyDecorator;
|
|
55
|
+
/**
|
|
56
|
+
* @queryAllShadow(selector, options?) — shadow DOM에서 모든 매칭 요소를 배열로 쿼리
|
|
57
|
+
*/
|
|
58
|
+
export declare function queryAllShadow(selector: string | QueryFnSelector, options?: QueryBaseOptions): PropertyDecorator;
|
|
22
59
|
/**
|
|
23
|
-
* @
|
|
60
|
+
* @queryAllLight(selector, options?) — light DOM에서 모든 매칭 요소를 배열로 쿼리
|
|
24
61
|
*/
|
|
25
|
-
export declare function
|
|
62
|
+
export declare function queryAllLight(selector: string | QueryFnSelector, options?: QueryBaseOptions): PropertyDecorator;
|
|
26
63
|
/**
|
|
27
|
-
* @
|
|
64
|
+
* @queryAllAll(selector, options?) — shadow+light 모두에서 모든 매칭 요소를 배열로 쿼리
|
|
28
65
|
*/
|
|
29
|
-
export declare function
|
|
66
|
+
export declare function queryAllAll(selector: string | QueryFnSelector, options?: QueryBaseOptions): PropertyDecorator;
|
|
30
67
|
/**
|
|
31
|
-
* @
|
|
68
|
+
* @queryIn(root, pick?) — root + pick 조합 팩토리.
|
|
69
|
+
* first/last/even/odd/all/number를 모두 지원하는 데코레이터를 생성한다.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* @queryIn('shadow', 'even')('.item') // shadow DOM 짝수 인덱스들
|
|
73
|
+
* @queryIn('light', 2)('.item') // light DOM 3번째 요소
|
|
74
|
+
* @queryIn('all')('.item') // root all, pick 기본 first
|
|
32
75
|
*/
|
|
33
|
-
export declare
|
|
76
|
+
export declare const queryIn: (root: SwcRootType, pick?: QueryPick) => (selector: string | QueryFnSelector, options?: QueryBaseOptions) => PropertyDecorator;
|
|
34
77
|
//# sourceMappingURL=query.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/decorators/query.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/decorators/query.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,aAA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Aa,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,iBAAiB,CAE/G;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,iBAAiB,CAEhH;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,iBAAiB,CAE/G;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,iBAAiB,CAE7G;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO,GAAI,MAAM,WAAW,EAAE,OAAO,SAAS,MACxD,UAAU,MAAM,GAAG,eAAe,EAAE,UAAU,gBAAgB,KAAG,iBACuB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ElementDefineLifeCycler, HelperHostSet } from '../types';
|
|
2
|
+
export declare const REQUEST_ANIMATION_FRAME_METADATA_KEY: unique symbol;
|
|
3
|
+
export type RequestAnimationFrameType = 'onConnected' | 'returnValue';
|
|
4
|
+
export interface RequestAnimationFrameOptions {
|
|
5
|
+
/**
|
|
6
|
+
* 'onConnected' - connect 시 자동으로 루프 시작 (매 프레임 데코레이트된 메서드를 직접 호출), disconnect 시 자동 정리.
|
|
7
|
+
* 'returnValue'(기본값) - 자동 시작 없음. 개발자가 이 메서드를 직접 호출해야 시작되고,
|
|
8
|
+
* 그 호출의 리턴값(또는 valueKey로 뽑은 값)이 실제로 매 프레임 호출될 함수가 된다.
|
|
9
|
+
*/
|
|
10
|
+
type?: RequestAnimationFrameType;
|
|
11
|
+
/** 루프 시작 직후 1회 호출 (디버깅/로깅용). id는 첫 requestAnimationFrame 반환값 - cleanup은 자동으로 처리되므로 직접 취소할 필요 없음. */
|
|
12
|
+
created?: (set: HelperHostSet, id: number) => void;
|
|
13
|
+
/**
|
|
14
|
+
* type:'returnValue' 전용 - 리턴값이 함수면 그 자체를, 객체면 이 키의 값이 함수일 때 그 값을
|
|
15
|
+
* "매 프레임 호출될 함수"로 사용한다. 안 주면 REQUEST_ANIMATION_FRAME_METADATA_KEY로 폴백한다 -
|
|
16
|
+
* applyAttribute.ts/applyNode.ts의 valueKey와 동일한 컨벤션.
|
|
17
|
+
*/
|
|
18
|
+
valueKey?: symbol | string;
|
|
19
|
+
}
|
|
20
|
+
export interface RequestAnimationFrameMetadata {
|
|
21
|
+
propertyKey: string | symbol;
|
|
22
|
+
options: RequestAnimationFrameOptions;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 프레임 콜백 시그니처.
|
|
26
|
+
* - timestamp: 이번 프레임의 시각 (requestAnimationFrame이 넘겨주는 값)
|
|
27
|
+
* - prevValue: 직전 호출이 리턴한 값 (첫 호출에서는 undefined)
|
|
28
|
+
* 리턴값이 undefined/null이면 다음 프레임을 예약하지 않고 루프가 멈춘다 (개발자가 종료를 제어).
|
|
29
|
+
* undefined/null이 아닌 값을 리턴하면 그 값 그대로 다음 호출의 prevValue로 전달된다.
|
|
30
|
+
*/
|
|
31
|
+
export type FrameCallback = (timestamp: number, prevValue?: any) => any;
|
|
32
|
+
/**
|
|
33
|
+
* type:'onConnected' - connect 시 자동으로 매 프레임 루프를 시작하고, disconnect 시 자동으로 cancelAnimationFrame 한다.
|
|
34
|
+
* type:'returnValue'(기본값) - 메서드를 감싸지 않는 대신, 호출될 때마다(개발자가 직접 호출) 원본 로직을
|
|
35
|
+
* 그대로 실행하고 리턴값(또는 valueKey로 뽑은 값)이 함수면 그 함수를 매 프레임 호출되는 루프로 등록한다.
|
|
36
|
+
* 원본 리턴값은 그대로 통과시키므로 다른 데코레이터와 같은 메서드에 스택해도 순서에 상관없이 안전하다.
|
|
37
|
+
*
|
|
38
|
+
* 옵션 없이 `@requestAnimationFrame` 그대로 붙여도 되고, `@requestAnimationFrame({...})`처럼 옵션을 줄 수도 있다.
|
|
39
|
+
*/
|
|
40
|
+
export declare function requestAnimationFrame(options?: RequestAnimationFrameOptions): MethodDecorator;
|
|
41
|
+
export declare function requestAnimationFrame(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
|
|
42
|
+
export declare const findAllRequestAnimationFrameMetadata: (target: any) => RequestAnimationFrameMetadata[];
|
|
43
|
+
export declare class RequestAnimationFrameLifeCycler implements ElementDefineLifeCycler {
|
|
44
|
+
onConnected(helperHostSet: HelperHostSet): void;
|
|
45
|
+
onDisconnected(helperHostSet: HelperHostSet): void;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=requestAnimationFrame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestAnimationFrame.d.ts","sourceRoot":"","sources":["../../../src/decorators/requestAnimationFrame.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAElE,eAAO,MAAM,oCAAoC,eAA6D,CAAC;AAE/G,MAAM,MAAM,yBAAyB,GAAG,aAAa,GAAG,aAAa,CAAC;AAEtE,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC,oGAAoG;IACpG,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,6BAA6B;IAC5C,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,OAAO,EAAE,4BAA4B,CAAC;CACvC;AAED;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC;AAoExE;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,4BAA4B,GAAG,eAAe,CAAC;AAC/F,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,kBAAkB,GAAG,IAAI,CAAC;AAa1H,eAAO,MAAM,oCAAoC,GAAI,QAAQ,GAAG,KAAG,6BAA6B,EAG/F,CAAC;AAEF,qBAAa,+BAAgC,YAAW,uBAAuB;IAC7E,WAAW,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI;IAY/C,cAAc,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI;CAWnD"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { SpecialSelector, SwcQueryOptions, HelperHostSet } from '../types';
|
|
2
|
-
|
|
3
|
-
export interface ResizeObserverOptions extends SwcQueryOptions {
|
|
4
|
-
delegate?: boolean;
|
|
1
|
+
import { SpecialSelector, SwcQueryOptions, SwcFnSelector, SwcSelector, HelperHostSet } from '../types';
|
|
2
|
+
export interface ResizeObserverBaseOptions {
|
|
5
3
|
box?: 'content-box' | 'border-box' | 'device-pixel-content-box';
|
|
6
4
|
filter?: (matchedEls: HTMLElement[], meta: {
|
|
7
5
|
currentThis: any;
|
|
@@ -9,29 +7,51 @@ export interface ResizeObserverOptions extends SwcQueryOptions {
|
|
|
9
7
|
}) => boolean;
|
|
10
8
|
removeObserver?: (target: Element, optionValue: ResizeObserverOptions) => void;
|
|
11
9
|
}
|
|
10
|
+
export type ResizeObserverQueryOptions = ResizeObserverBaseOptions & SwcQueryOptions & {
|
|
11
|
+
delegate?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type ResizeObserverNonQueryOptions = ResizeObserverBaseOptions;
|
|
14
|
+
export type ResizeObserverOptions = ResizeObserverQueryOptions;
|
|
15
|
+
export type ResizeObserverOptionsOf<S extends SwcSelector> = S extends string ? ResizeObserverQueryOptions : ResizeObserverNonQueryOptions;
|
|
12
16
|
export interface ResizeObserverMetadata {
|
|
13
17
|
propertyKey: string | symbol;
|
|
14
|
-
selector:
|
|
18
|
+
selector: SwcSelector;
|
|
15
19
|
options: ResizeObserverOptions;
|
|
16
20
|
}
|
|
17
21
|
export declare const RESIZE_OBSERVER_METADATA_KEY: unique symbol;
|
|
18
|
-
export declare function resizeObserver(target: SpecialSelector, options?:
|
|
19
|
-
export declare function resizeObserver(selector:
|
|
20
|
-
export declare function resizeObserver(options?:
|
|
21
|
-
export declare function
|
|
22
|
-
export declare function
|
|
23
|
-
export declare function
|
|
24
|
-
export declare function
|
|
25
|
-
export declare function
|
|
26
|
-
export declare function
|
|
27
|
-
export declare function
|
|
28
|
-
export declare function
|
|
29
|
-
export declare function
|
|
30
|
-
export declare function
|
|
31
|
-
export declare function
|
|
32
|
-
export declare function
|
|
33
|
-
export declare function
|
|
34
|
-
export declare function
|
|
35
|
-
export declare function
|
|
22
|
+
export declare function resizeObserver(target: SpecialSelector, options?: ResizeObserverQueryOptions): MethodDecorator;
|
|
23
|
+
export declare function resizeObserver(selector: string, options?: ResizeObserverQueryOptions): MethodDecorator;
|
|
24
|
+
export declare function resizeObserver(selector: SwcFnSelector, options?: ResizeObserverNonQueryOptions): MethodDecorator;
|
|
25
|
+
export declare function resizeObserver(options?: ResizeObserverQueryOptions): MethodDecorator;
|
|
26
|
+
export declare function resizeObserver(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
|
|
27
|
+
export declare function resizeObserverThis(options?: ResizeObserverQueryOptions): MethodDecorator;
|
|
28
|
+
export declare function resizeObserverThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
|
|
29
|
+
export declare function resizeObserverDelegateLight(selector: string, options?: Omit<ResizeObserverQueryOptions, 'delegate'>): MethodDecorator;
|
|
30
|
+
export declare function resizeObserverDelegateLight(options?: Omit<ResizeObserverQueryOptions, 'delegate'>): MethodDecorator;
|
|
31
|
+
export declare function resizeObserverDelegateLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
|
|
32
|
+
export declare function resizeObserverDelegateShadow(selector: string, options?: Omit<ResizeObserverQueryOptions, 'delegate'>): MethodDecorator;
|
|
33
|
+
export declare function resizeObserverDelegateShadow(options?: Omit<ResizeObserverQueryOptions, 'delegate'>): MethodDecorator;
|
|
34
|
+
export declare function resizeObserverDelegateShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
|
|
35
|
+
export declare function resizeObserverDelegateAll(selector: string, options?: Omit<ResizeObserverQueryOptions, 'delegate'>): MethodDecorator;
|
|
36
|
+
export declare function resizeObserverDelegateAll(options?: Omit<ResizeObserverQueryOptions, 'delegate'>): MethodDecorator;
|
|
37
|
+
export declare function resizeObserverDelegateAll(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
|
|
38
|
+
export declare function resizeObserverDelegate(selector: string, options?: Omit<ResizeObserverQueryOptions, 'delegate'>): MethodDecorator;
|
|
39
|
+
export declare function resizeObserverDelegate(options?: Omit<ResizeObserverQueryOptions, 'delegate'>): MethodDecorator;
|
|
40
|
+
export declare function resizeObserverDelegate(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
|
|
41
|
+
export declare function resizeObserverLight(selector: string, options?: ResizeObserverQueryOptions): MethodDecorator;
|
|
42
|
+
export declare function resizeObserverLight(options?: ResizeObserverQueryOptions): MethodDecorator;
|
|
43
|
+
export declare function resizeObserverLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
|
|
44
|
+
export declare function resizeObserverShadow(selector: string, options?: ResizeObserverQueryOptions): MethodDecorator;
|
|
45
|
+
export declare function resizeObserverShadow(options?: ResizeObserverQueryOptions): MethodDecorator;
|
|
46
|
+
export declare function resizeObserverShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
|
|
47
|
+
export declare function resizeObserverAll(selector: string, options?: ResizeObserverQueryOptions): MethodDecorator;
|
|
48
|
+
export declare function resizeObserverAll(options?: ResizeObserverQueryOptions): MethodDecorator;
|
|
49
|
+
export declare function resizeObserverAll(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
|
|
36
50
|
export declare function getResizeObserverMetadata(target: any): ResizeObserverMetadata[] | undefined;
|
|
51
|
+
import { ElementDefineLifeCycler, OnConnectedResult } from '../types';
|
|
52
|
+
export declare class ResizeObserverLifeCycler implements ElementDefineLifeCycler {
|
|
53
|
+
private readonly removeObserverCallbacksMap;
|
|
54
|
+
onConnected(helperHostSet: HelperHostSet): OnConnectedResult | void;
|
|
55
|
+
onDisconnected(helperHostSet: HelperHostSet): void;
|
|
56
|
+
}
|
|
37
57
|
//# sourceMappingURL=resizeObserver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizeObserver.d.ts","sourceRoot":"","sources":["../../../src/decorators/resizeObserver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"resizeObserver.d.ts","sourceRoot":"","sources":["../../../src/decorators/resizeObserver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGvG,MAAM,WAAW,yBAAyB;IACxC,GAAG,CAAC,EAAE,aAAa,GAAG,YAAY,GAAG,0BAA0B,CAAC;IAChE,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE;QAAE,WAAW,EAAE,GAAG,CAAC;QAAC,MAAM,EAAE,aAAa,CAAA;KAAE,KAAK,OAAO,CAAC;IACnG,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,qBAAqB,KAAK,IAAI,CAAC;CAChF;AAGD,MAAM,MAAM,0BAA0B,GAAG,yBAAyB,GAAG,eAAe,GAAG;IAAE,QAAQ,C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A+G;IAE1J,WAAW,CAAC,aAAa,EAAE,aAAa,GAAG,iBAAiB,GAAG,IAAI;IA+EnE,cAAc,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI;CAOnD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ElementDefineLifeCycler, HelperHostSet } from '../types';
|
|
2
|
+
export declare const SET_INTERVAL_METADATA_KEY: unique symbol;
|
|
3
|
+
export type SetIntervalType = 'onConnected' | 'returnValue';
|
|
4
|
+
export interface SetIntervalOptions {
|
|
5
|
+
/**
|
|
6
|
+
* 'onConnected' (connect 시 자동으로 시작, disconnect 시 자동 정리) |
|
|
7
|
+
* 'returnValue' (기본값 - 자동 시작 없음. 개발자가 이 메서드를 직접 호출해야 시작되고,
|
|
8
|
+
* 그 호출의 리턴값이 실제로 반복 실행될 함수가 된다 - 아래 설명 참고).
|
|
9
|
+
*/
|
|
10
|
+
type?: SetIntervalType;
|
|
11
|
+
/** 매 tick마다 데코레이트된 메서드에 넘길 인자를 계산. type:'onConnected'에서만 의미가 있음 (없으면 인자 없이 호출). */
|
|
12
|
+
parameter?: (set: HelperHostSet) => any[];
|
|
13
|
+
/** 타이머 등록 직후 1회 호출 (디버깅/로깅용). id는 실제 setInterval 반환값 - cleanup은 자동으로 처리되므로 직접 clear할 필요 없음. */
|
|
14
|
+
created?: (set: HelperHostSet, id: number) => void;
|
|
15
|
+
/**
|
|
16
|
+
* type:'onConnected' - 매 tick마다 데코레이트된 메서드의 리턴값이 객체이고 이 키의 값이 함수이면 (id: number)로 호출한다.
|
|
17
|
+
* type:'returnValue' - 리턴값이 함수면 그 자체를, 객체면 이 키의 값이 함수일 때 그 값을 "실제로 반복 실행될 함수"로 사용한다.
|
|
18
|
+
* 안 주면 SET_INTERVAL_METADATA_KEY로 폴백한다 - applyAttribute.ts/applyNode.ts의 valueKey와 동일한 컨벤션
|
|
19
|
+
* (리턴 객체에서 이 데코레이터 몫만 뽑아 쓰고, 다른 데코레이터와 스택할 때만 커스텀 키로 구분하면 된다).
|
|
20
|
+
*/
|
|
21
|
+
valueKey?: symbol | string;
|
|
22
|
+
}
|
|
23
|
+
export interface SetIntervalMetadata {
|
|
24
|
+
propertyKey: string | symbol;
|
|
25
|
+
interval: number;
|
|
26
|
+
options: SetIntervalOptions;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* type:'onConnected' - connect 시 자동으로 setInterval을 걸고, disconnect 시 자동으로 clearInterval 한다.
|
|
30
|
+
* type:'returnValue'(기본값) - 메서드를 감싸지 않는 대신, 호출될 때마다(개발자가 직접 호출) 원본 로직을
|
|
31
|
+
* 그대로 실행하고 리턴값(또는 valueKey로 뽑은 값)이 함수면 그 함수를 새 setInterval의 반복 콜백으로 등록한다.
|
|
32
|
+
* 호출할 때마다 별도의 새 타이머가 생기며, disconnect 시 전부 정리된다. 원본 리턴값은 그대로 통과시키므로
|
|
33
|
+
* 다른 데코레이터와 같은 메서드에 스택해도 순서에 상관없이 안전하다.
|
|
34
|
+
*/
|
|
35
|
+
export declare function setInterval(interval: number, options?: SetIntervalOptions): MethodDecorator;
|
|
36
|
+
export declare const findAllSetIntervalMetadata: (target: any) => SetIntervalMetadata[];
|
|
37
|
+
export declare class SetIntervalLifeCycler implements ElementDefineLifeCycler {
|
|
38
|
+
onConnected(helperHostSet: HelperHostSet): void;
|
|
39
|
+
onDisconnected(helperHostSet: HelperHostSet): void;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=setInterval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setInterval.d.ts","sourceRoot":"","sources":["../../../src/decorators/setInterval.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAElE,eAAO,MAAM,yBAAyB,eAAkD,CAAC;AAEzF,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,aAAa,CAAC;AAE5D,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,mFAAmF;IACnF,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,GAAG,EAAE,CAAC;IAC1C,+FAA+F;IAC/F,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,kBAAkB,CAAC;CAC7B;AAYD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB,GAAG,eAAe,CA0C/F;AAED,eAAO,MAAM,0BAA0B,GAAI,QAAQ,GAAG,KAAG,mBAAmB,EAG3E,CAAC;AAEF,qBAAa,qBAAsB,YAAW,uBAAuB;IACnE,WAAW,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI;IAsB/C,cAAc,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI;CAWnD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ElementDefineLifeCycler, HelperHostSet } from '../types';
|
|
2
|
+
export declare const SET_TIMEOUT_METADATA_KEY: unique symbol;
|
|
3
|
+
export type SetTimeoutType = 'onConnected' | 'returnValue';
|
|
4
|
+
export interface SetTimeoutOptions {
|
|
5
|
+
/**
|
|
6
|
+
* 'onConnected' (connect 시 자동으로 예약, disconnect 시 자동 정리) |
|
|
7
|
+
* 'returnValue' (기본값 - 자동 예약 없음. 개발자가 이 메서드를 직접 호출해야 예약되고,
|
|
8
|
+
* 그 호출의 리턴값이 실제로 실행될 함수가 된다 - 아래 설명 참고).
|
|
9
|
+
*/
|
|
10
|
+
type?: SetTimeoutType;
|
|
11
|
+
/** 실행 시 데코레이트된 메서드에 넘길 인자를 계산. type:'onConnected'에서만 의미가 있음 (없으면 인자 없이 호출). */
|
|
12
|
+
parameter?: (set: HelperHostSet) => any[];
|
|
13
|
+
/** 타이머 등록 직후 1회 호출 (디버깅/로깅용). id는 실제 setTimeout 반환값 - cleanup은 자동으로 처리되므로 직접 clear할 필요 없음. */
|
|
14
|
+
created?: (set: HelperHostSet, id: number) => void;
|
|
15
|
+
/**
|
|
16
|
+
* type:'onConnected' - fire 시 데코레이트된 메서드의 리턴값이 객체이고 이 키의 값이 함수이면 (id: number)로 호출한다.
|
|
17
|
+
* type:'returnValue' - 리턴값이 함수면 그 자체를, 객체면 이 키의 값이 함수일 때 그 값을 "실제로 실행될 함수"로 사용한다.
|
|
18
|
+
* 안 주면 SET_TIMEOUT_METADATA_KEY로 폴백한다 - applyAttribute.ts/applyNode.ts의 valueKey와 동일한 컨벤션
|
|
19
|
+
* (리턴 객체에서 이 데코레이터 몫만 뽑아 쓰고, 다른 데코레이터와 스택할 때만 커스텀 키로 구분하면 된다).
|
|
20
|
+
*/
|
|
21
|
+
valueKey?: symbol | string;
|
|
22
|
+
}
|
|
23
|
+
export interface SetTimeoutMetadata {
|
|
24
|
+
propertyKey: string | symbol;
|
|
25
|
+
delay: number;
|
|
26
|
+
options: SetTimeoutOptions;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* type:'onConnected' - connect 시 자동으로 setTimeout을 걸고, disconnect 시 (아직 실행 전이라면) 자동으로 clearTimeout 한다.
|
|
30
|
+
* type:'returnValue'(기본값) - 메서드를 감싸지 않는 대신, 호출될 때마다(개발자가 직접 호출) 원본 로직을
|
|
31
|
+
* 그대로 실행하고 리턴값(또는 valueKey로 뽑은 값)이 함수면 그 함수를 새 setTimeout으로 예약한다.
|
|
32
|
+
* 호출할 때마다 별도의 새 타이머가 생기며, disconnect 시 (아직 실행 전인 것들은) 전부 정리된다.
|
|
33
|
+
* 원본 리턴값은 그대로 통과시키므로 다른 데코레이터와 같은 메서드에 스택해도 순서에 상관없이 안전하다.
|
|
34
|
+
*/
|
|
35
|
+
export declare function setTimeout(delay: number, options?: SetTimeoutOptions): MethodDecorator;
|
|
36
|
+
export declare const findAllSetTimeoutMetadata: (target: any) => SetTimeoutMetadata[];
|
|
37
|
+
export declare class SetTimeoutLifeCycler implements ElementDefineLifeCycler {
|
|
38
|
+
onConnected(helperHostSet: HelperHostSet): void;
|
|
39
|
+
onDisconnected(helperHostSet: HelperHostSet): void;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=setTimeout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setTimeout.d.ts","sourceRoot":"","sources":["../../../src/decorators/setTimeout.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAElE,eAAO,MAAM,wBAAwB,eAAiD,CAAC;AAEvF,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,aAAa,CAAC;AAE3D,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,GAAG,EAAE,CAAC;IAC1C,8FAA8F;IAC9F,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAYD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB,GAAG,eAAe,CA6C1F;AAED,eAAO,MAAM,yBAAyB,GAAI,QAAQ,GAAG,KAAG,kBAAkB,EAGzE,CAAC;AAEF,qBAAa,oBAAqB,YAAW,uBAAuB;IAClE,WAAW,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI;IAsB/C,cAAc,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI;CAWnD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SwcAppMessage } from '../types';
|
|
1
|
+
import { SwcAppMessage, HelperHostSet } from '../types';
|
|
2
2
|
export declare const SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY: unique symbol;
|
|
3
3
|
export interface SwcAppMessageSubscriberMetadata {
|
|
4
4
|
propertyKey: string | symbol;
|
|
@@ -14,4 +14,10 @@ export declare function subscribeSwcAppMessageWhileConnected(options: SwcAppMess
|
|
|
14
14
|
export declare function subscribeSwcAppMessageWhileConnected(messageType: string, options: SwcAppMessageOptions): MethodDecorator;
|
|
15
15
|
export declare const receiveMessage: typeof subscribeSwcAppMessageWhileConnected;
|
|
16
16
|
export declare const getSubscribeSwcAppMessageWhileConnectedMetadata: (target: any) => SwcAppMessageSubscriberMetadata[] | undefined;
|
|
17
|
+
import { ElementDefineLifeCycler } from '../types';
|
|
18
|
+
export declare class MessageSubscribeLifeCycler implements ElementDefineLifeCycler {
|
|
19
|
+
onConnected(_helperHostSet: HelperHostSet): void;
|
|
20
|
+
/** SwcAppMixin 이 구독 대상 메타를 꺼낼 때 사용 */
|
|
21
|
+
getMetadata(helperHostSet: HelperHostSet): SwcAppMessageSubscriberMetadata[] | undefined;
|
|
22
|
+
}
|
|
17
23
|
//# sourceMappingURL=subscribeSwcAppMessageWhileConnected.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscribeSwcAppMessageWhileConnected.d.ts","sourceRoot":"","sources":["../../../src/decorators/subscribeSwcAppMessageWhileConnected.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,
|
|
1
|
+
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+B,EAAE,GAAG,SAAS;CAGzF"}
|
|
@@ -22,4 +22,10 @@ export declare function subscribeSwcAppRouteChangeWhileConnected(pathPattern: Ro
|
|
|
22
22
|
export declare function subscribeSwcAppRouteChangeWhileConnected(options: SwcAppRouteChangeOptions): MethodDecorator;
|
|
23
23
|
export declare const changedRoute: typeof subscribeSwcAppRouteChangeWhileConnected;
|
|
24
24
|
export declare const getSubscribeSwcAppRouteChangeWhileConnectedMetadata: (target: any) => SwcAppRouteChangeSubscriberMetadata[];
|
|
25
|
+
import { ElementDefineLifeCycler } from '../types';
|
|
26
|
+
export declare class RouteSubscribeLifeCycler implements ElementDefineLifeCycler {
|
|
27
|
+
onConnected(_helperHostSet: HelperHostSet): void;
|
|
28
|
+
/** SwcAppMixin 이 구독 대상 메타를 꺼낼 때 사용 */
|
|
29
|
+
getMetadata(helperHostSet: HelperHostSet): SwcAppRouteChangeSubscriberMetadata[];
|
|
30
|
+
}
|
|
25
31
|
//# sourceMappingURL=subscribeSwcAppRouteChangeWhileConnected.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscribeSwcAppRouteChangeWhileConnected.d.ts","sourceRoot":"","sources":["../../../src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,2DAA2D,eAAoF,CAAC;AAE7J,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;AAE1F,MAAM,WAAW,mCAAmC;IAClD,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,wBAAwB,CAAC;CACpC;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,a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ts","sourceRoot":"","sources":["../../../src/elements/SwcAppMixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,aAAa,EAAE,MAAM,UAAU,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAA2C,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAC,eAAe,EAAa,MAAM,uBAAuB,CAAC;AAGlE,eAAO,MAAM,KAAK,GAAI,GAAG,WAAW,YAEnC,CAAC;AACF,eAAO,MAAM,eAAe,GAAI,GAAG,WAAW,SAE7C,CAAC;AACF,eAAO,MAAM,kBAAkB,GAAI,GAAG,WAAW,SAEhD,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,WAAW,CAAA;CAAE,EAAE,IAAI,EAAE,CAAC;kBAmB3D,GAAG,EAAE;;;8BAfJ,YAAY;2BACf,eAAe;;;uCAIH,GAAG;wCACF,GAAG;QAEnC;;;;WAIG;;;;;gDAoB2C,WAAW,MAAM,eAAe;
|
|
1
|
+
{"version":3,"file":"SwcAppMixin.d.ts","sourceRoot":"","sources":["../../../src/elements/SwcAppMixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,aAAa,EAAE,MAAM,UAAU,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAA2C,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAC,eAAe,EAAa,MAAM,uBAAuB,CAAC;AAGlE,eAAO,MAAM,KAAK,GAAI,GAAG,WAAW,YAEnC,CAAC;AACF,eAAO,MAAM,eAAe,GAAI,GAAG,WAAW,SAE7C,CAAC;AACF,eAAO,MAAM,kBAAkB,GAAI,GAAG,WAAW,SAEhD,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,WAAW,CAAA;CAAE,EAAE,IAAI,EAAE,CAAC;kBAmB3D,GAAG,EAAE;;;8BAfJ,YAAY;2BACf,eAAe;;;uCAIH,GAAG;wCACF,GAAG;QAEnC;;;;WAIG;;;;;gDAoB2C,WAAW,MAAM,eAAe;6BA+FnD,WAAW,WAAW;YAAE,YAAY,EAAE,OAAO,CAAA;SAAE;iCAuD3C,GAAG;gCAQV,GAAG;kCAOK,eAAe;yBAOxB,sBAAsB;;;sBAgFzB,MAAM;gBAIlB,IAAI;mBAID,IAAI;kBAIL,IAAI;gCAIU,aAAa,GAAG,IAAI;4CAMR,GAAG,WAAW,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAmClE"}
|
|
@@ -39,6 +39,8 @@ export type HostSet = {
|
|
|
39
39
|
export type HelperHostSet = HelperSet & HostSet & {
|
|
40
40
|
$this: any;
|
|
41
41
|
};
|
|
42
|
+
export type SwcFnSelector = (currentThis: any, helper: HelperHostSet) => Node | NodeList | Element | Element[] | null;
|
|
43
|
+
export type SwcSelector = string | SwcFnSelector;
|
|
42
44
|
export type SwcAppMessage<T = any> = {
|
|
43
45
|
publisher?: any;
|
|
44
46
|
data?: T;
|
|
@@ -58,4 +60,106 @@ export interface SwcAppInterface extends HTMLElement {
|
|
|
58
60
|
export interface SwcElement {
|
|
59
61
|
_swcId: string;
|
|
60
62
|
}
|
|
63
|
+
/** observer observe 대상 엔트리. delegate:true 이면 target 은 셀렉터 문자열이며, 실제 요소는 동적 추적으로 observe/unobserve 된다. */
|
|
64
|
+
export interface ObserverObserveTarget<TOptions> {
|
|
65
|
+
target: Element | ShadowRoot | string;
|
|
66
|
+
options?: TOptions;
|
|
67
|
+
delegate?: boolean;
|
|
68
|
+
/** delegate 동적 추적 시 observe/unobserve 를 실행할 루트(스코프). delegate:true 일 때만 의미 있다. */
|
|
69
|
+
delegateRoot?: SwcRootType;
|
|
70
|
+
}
|
|
71
|
+
/** MutationObserver observe 대상 하나. 동일 루트의 여러 대상은 같은 callback 을 공유한다. */
|
|
72
|
+
export interface MutationObserverSetEntry {
|
|
73
|
+
target: Element | ShadowRoot | string;
|
|
74
|
+
options?: MutationObserverInit;
|
|
75
|
+
delegate?: boolean;
|
|
76
|
+
delegateRoot?: SwcRootType;
|
|
77
|
+
callback: (mutations: MutationRecord[], observer: MutationObserver) => void;
|
|
78
|
+
}
|
|
79
|
+
/** observe 할 대상 목록 (엔트리별 콜백 포함). elementDefine 이 하나의 MutationObserver 로 모두 observe 한다. */
|
|
80
|
+
export type MutationObserverSet = MutationObserverSetEntry[];
|
|
81
|
+
/** ResizeObserver observe 대상 하나. 동일 셀렉터의 여러 대상은 같은 callback 을 공유한다. */
|
|
82
|
+
export interface ResizeObserverSetEntry {
|
|
83
|
+
target: Element | ShadowRoot | string;
|
|
84
|
+
options?: ResizeObserverOptions;
|
|
85
|
+
delegate?: boolean;
|
|
86
|
+
delegateRoot?: SwcRootType;
|
|
87
|
+
callback: (entries: ResizeObserverEntry[], observer: ResizeObserver) => void;
|
|
88
|
+
}
|
|
89
|
+
/** observe 할 대상 목록 (엔트리별 콜백 포함). elementDefine 이 하나의 ResizeObserver 로 모두 observe 한다. */
|
|
90
|
+
export type ResizeObserverSet = ResizeObserverSetEntry[];
|
|
91
|
+
/** IntersectionObserver observe 대상 하나. 같은 옵션 그룹의 여러 대상은 같은 callback 을 공유한다. */
|
|
92
|
+
export interface IntersectionObserverSetEntry {
|
|
93
|
+
target: Element | ShadowRoot | string;
|
|
94
|
+
delegate?: boolean;
|
|
95
|
+
delegateRoot?: SwcRootType;
|
|
96
|
+
callback: (entries: IntersectionObserverEntry[], observer: IntersectionObserver) => void;
|
|
97
|
+
}
|
|
98
|
+
/** IntersectionObserver 그룹. observer 는 생성 시점에 옵션이 고정되므로 옵션별로 1개씩 생성된다. */
|
|
99
|
+
export interface IntersectionObserverGroup {
|
|
100
|
+
/** observer 생성 옵션 (threshold/rootMargin/root). 이 값이 같으면 같은 observer 를 공유한다. */
|
|
101
|
+
options: IntersectionObserverInit;
|
|
102
|
+
observeTargets: IntersectionObserverSetEntry[];
|
|
103
|
+
}
|
|
104
|
+
/** observe 할 옵션 그룹 목록. elementDefine 이 그룹마다 IntersectionObserver 를 생성한다. */
|
|
105
|
+
export type IntersectionObserverSet = IntersectionObserverGroup[];
|
|
106
|
+
/**
|
|
107
|
+
* onConnected 의 반환 타입.
|
|
108
|
+
* observer 가 필요 없는 cycler 는 undefined 를 반환해도 된다.
|
|
109
|
+
*/
|
|
110
|
+
export interface OnConnectedResult {
|
|
111
|
+
mutationObserverSet?: MutationObserverSet;
|
|
112
|
+
resizeObserverSet?: ResizeObserverSet;
|
|
113
|
+
intersectionObserverSet?: IntersectionObserverSet;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* 각 데코레이터 파일이 구현하는 라이프사이클 위임 interface.
|
|
117
|
+
*
|
|
118
|
+
* 구현체는 상태를 갖지 않고, 각 훅의 첫 번째 인자로 HelperHostSet 을 받는다.
|
|
119
|
+
* 관심 있는 훅만 구현하면 된다 (전부 optional).
|
|
120
|
+
*
|
|
121
|
+
* ```ts
|
|
122
|
+
* const eventCycler = new EventListenerLifeCycler();
|
|
123
|
+
* const cyclers: ElementDefineLifeCycler[] = [eventCycler, ...]; // elementDefine 시 1회 생성
|
|
124
|
+
*
|
|
125
|
+
* proto.connectedCallback = async function () {
|
|
126
|
+
* const helperHostSet = SwcUtils.getHelperAndHostSet(win, this);
|
|
127
|
+
* const results = await Promise.all(cyclers.map(c => c.onConnected?.(helperHostSet)));
|
|
128
|
+
* // results 에서 mutationObserverSet / resizeObserverSet 수집
|
|
129
|
+
* // → 필요한 경우에만 MutationObserver / ResizeObserver 생성
|
|
130
|
+
* };
|
|
131
|
+
* proto.disconnectedCallback = function () {
|
|
132
|
+
* for (const c of cyclers) c.onDisconnected?.(helperHostSet);
|
|
133
|
+
* };
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
export interface ElementDefineLifeCycler {
|
|
137
|
+
/**
|
|
138
|
+
* connectedCallback 시 호출.
|
|
139
|
+
* observer 가 필요하면 OnConnectedResult 를 반환하고,
|
|
140
|
+
* 필요 없으면 void / undefined 를 반환한다.
|
|
141
|
+
* @param helperHostSet 현재 엘리먼트 인스턴스($this)를 포함한 컨텍스트
|
|
142
|
+
* @param resizeObserverSet 이전 시클러가 반환한 resize observer set (mutation 시클러가 주입받아 사용)
|
|
143
|
+
*/
|
|
144
|
+
onConnected?(helperHostSet: HelperHostSet, resizeObserverSet?: ResizeObserverSet): OnConnectedResult | void | Promise<OnConnectedResult | void>;
|
|
145
|
+
/** disconnectedCallback 시 호출. 등록한 리소스를 해제한다. */
|
|
146
|
+
onDisconnected?(helperHostSet: HelperHostSet): void;
|
|
147
|
+
/** adoptedCallback 시 호출 (선택적). */
|
|
148
|
+
onAdopted?(helperHostSet: HelperHostSet): void;
|
|
149
|
+
/**
|
|
150
|
+
* attributeChangedCallback 시 호출 (선택적).
|
|
151
|
+
* @param helperHostSet 현재 엘리먼트 인스턴스($this)를 포함한 컨텍스트
|
|
152
|
+
* @param name 변경된 attribute 이름
|
|
153
|
+
* @param oldVal 이전 값
|
|
154
|
+
* @param newVal 새 값 (ActionExpression 처리 후)
|
|
155
|
+
*/
|
|
156
|
+
onAttributeChanged?(helperHostSet: HelperHostSet, name: string, oldVal: string | null, newVal: any): void;
|
|
157
|
+
/**
|
|
158
|
+
* observedAttributes 에 포함해야 하는 attribute 이름 목록을 반환한다.
|
|
159
|
+
* elementDefine 이 define-time(constructor)에 호출해 수집한다.
|
|
160
|
+
* 관심 없으면 구현하지 않거나 빈 배열을 반환한다.
|
|
161
|
+
* @param target constructor 또는 element 인스턴스 (메타데이터 조회용)
|
|
162
|
+
*/
|
|
163
|
+
getObservedAttributeNames?(target: any): string[];
|
|
164
|
+
}
|
|
61
165
|
//# sourceMappingURL=index.d.ts.map
|