native-document 1.0.62 → 1.0.63
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/package.json +1 -1
- package/src/wrappers/NDElement.js +1 -1
- package/types/nd-element.d.ts +10 -1
package/package.json
CHANGED
package/types/nd-element.d.ts
CHANGED
|
@@ -6,6 +6,12 @@ interface MethodsObject {
|
|
|
6
6
|
[methodName: string]: (this: NDElement, ...args: any[]) => any;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
export type ExtractMethods<T extends MethodsObject> = {
|
|
10
|
+
[K in keyof T]: T[K] extends (this: NDElement, ...args: infer Args) => infer R
|
|
11
|
+
? (...args: Args) => R
|
|
12
|
+
: never;
|
|
13
|
+
};
|
|
14
|
+
|
|
9
15
|
export interface NDElement {
|
|
10
16
|
readonly __$isNDElement: true;
|
|
11
17
|
readonly $element: HTMLElement;
|
|
@@ -14,8 +20,11 @@ export interface NDElement {
|
|
|
14
20
|
|
|
15
21
|
ref(target: any, name: string): this;
|
|
16
22
|
refSelf(target: any, name: string): this;
|
|
17
|
-
with(methods:
|
|
23
|
+
with<T extends MethodsObject>(methods: T): this & ExtractMethods<T>;
|
|
18
24
|
extend(methods: MethodsObject): NDElement;
|
|
25
|
+
extend<T extends MethodsObject>(
|
|
26
|
+
methods: T
|
|
27
|
+
): NDElement & { prototype: NDElement & ExtractMethods<T> };
|
|
19
28
|
|
|
20
29
|
unmountChildren(): this;
|
|
21
30
|
remove(): this;
|