wrec 0.28.0 → 0.29.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/wrec-ssr.d.ts +92 -0
- package/dist/wrec.d.ts +92 -0
- package/package.json +1 -1
package/dist/wrec-ssr.d.ts
CHANGED
|
@@ -1 +1,93 @@
|
|
|
1
|
+
declare type AnyClass = new (...args: any[]) => any;
|
|
2
|
+
|
|
3
|
+
declare type ChangeCallback = (change: StateChange) => void;
|
|
4
|
+
|
|
5
|
+
export declare function createElement(name: string, attributes: StringToString, innerHTML: string): HTMLElement;
|
|
6
|
+
|
|
7
|
+
export declare function css(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
8
|
+
|
|
9
|
+
export declare function html(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
10
|
+
|
|
11
|
+
declare const HTMLElementBase: {
|
|
12
|
+
new (): HTMLElement;
|
|
13
|
+
prototype: HTMLElement;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
declare type LooseObject = Record<string, unknown>;
|
|
17
|
+
|
|
18
|
+
declare type PropertyConfig = {
|
|
19
|
+
computed?: string;
|
|
20
|
+
dispatch?: boolean;
|
|
21
|
+
required?: boolean;
|
|
22
|
+
type: AnyClass;
|
|
23
|
+
usedBy?: string | string[];
|
|
24
|
+
value?: any;
|
|
25
|
+
values?: string[];
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
declare type StateChange = {
|
|
29
|
+
state: WrecState;
|
|
30
|
+
statePath: string;
|
|
31
|
+
oldValue: unknown;
|
|
32
|
+
newValue: unknown;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
declare type StringToAny = Record<string, any>;
|
|
36
|
+
|
|
37
|
+
declare type StringToString = Record<string, string>;
|
|
38
|
+
|
|
39
|
+
export declare abstract class Wrec extends HTMLElementBase {
|
|
40
|
+
#private;
|
|
41
|
+
private static attrToPropMap;
|
|
42
|
+
private static propToAttrMap;
|
|
43
|
+
static context: {};
|
|
44
|
+
static css: string;
|
|
45
|
+
private static elementName;
|
|
46
|
+
static formAssociated: boolean;
|
|
47
|
+
static html: string;
|
|
48
|
+
static properties: Record<string, PropertyConfig>;
|
|
49
|
+
private static propToComputedMap;
|
|
50
|
+
private static methodToExprsMap;
|
|
51
|
+
private static propToExprsMap;
|
|
52
|
+
private static template;
|
|
53
|
+
[key: string]: any;
|
|
54
|
+
static define(elementName: string): void;
|
|
55
|
+
constructor();
|
|
56
|
+
attributeChangedCallback(attrName: string, _oldValue: string | null, newValue: string | null): void;
|
|
57
|
+
batchSet(changes: StringToAny): void;
|
|
58
|
+
private static buildHTML;
|
|
59
|
+
changed(_statePath: string, componentProp: string, newValue: unknown): void;
|
|
60
|
+
connectedCallback(): Promise<void>;
|
|
61
|
+
disconnectedCallback(): void;
|
|
62
|
+
dispatch(name: string, detail: any): void;
|
|
63
|
+
displayIfSet(value: any, display?: string): string;
|
|
64
|
+
formAssociatedCallback(): void;
|
|
65
|
+
formResetCallback(): void;
|
|
66
|
+
private static getAttrName;
|
|
67
|
+
static getPropName(attrName: string): string;
|
|
68
|
+
static get observedAttributes(): string[];
|
|
69
|
+
propertyChangedCallback(_propName: string, _oldValue: unknown, _newValue: unknown): void;
|
|
70
|
+
ready(): void;
|
|
71
|
+
setAttributeSafe(name: string, value: string): void;
|
|
72
|
+
setFormValue(propName: string, value: string): void;
|
|
73
|
+
static ssr(properties?: StringToAny): string;
|
|
74
|
+
/**
|
|
75
|
+
* @param state - WrecState object
|
|
76
|
+
* @param map - object whose keys are state properties and
|
|
77
|
+
* whose values are component properties
|
|
78
|
+
*/
|
|
79
|
+
useState(state: WrecState, map?: StringToString): void;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export declare class WrecState {
|
|
83
|
+
#private;
|
|
84
|
+
static get(name: string): WrecState | undefined;
|
|
85
|
+
[key: string]: unknown;
|
|
86
|
+
constructor(name: string, persist: boolean, initial?: LooseObject);
|
|
87
|
+
subscribe(callback: ChangeCallback, paths?: string[]): () => void;
|
|
88
|
+
addProperty(propName: string, initialValue: unknown): void;
|
|
89
|
+
get id(): symbol;
|
|
90
|
+
log(): void;
|
|
91
|
+
}
|
|
92
|
+
|
|
1
93
|
export { }
|
package/dist/wrec.d.ts
CHANGED
|
@@ -1 +1,93 @@
|
|
|
1
|
+
declare type AnyClass = new (...args: any[]) => any;
|
|
2
|
+
|
|
3
|
+
declare type ChangeCallback = (change: StateChange) => void;
|
|
4
|
+
|
|
5
|
+
export declare function createElement(name: string, attributes: StringToString, innerHTML: string): HTMLElement;
|
|
6
|
+
|
|
7
|
+
export declare function css(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
8
|
+
|
|
9
|
+
export declare function html(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
10
|
+
|
|
11
|
+
declare const HTMLElementBase: {
|
|
12
|
+
new (): HTMLElement;
|
|
13
|
+
prototype: HTMLElement;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
declare type LooseObject = Record<string, unknown>;
|
|
17
|
+
|
|
18
|
+
declare type PropertyConfig = {
|
|
19
|
+
computed?: string;
|
|
20
|
+
dispatch?: boolean;
|
|
21
|
+
required?: boolean;
|
|
22
|
+
type: AnyClass;
|
|
23
|
+
usedBy?: string | string[];
|
|
24
|
+
value?: any;
|
|
25
|
+
values?: string[];
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
declare type StateChange = {
|
|
29
|
+
state: WrecState;
|
|
30
|
+
statePath: string;
|
|
31
|
+
oldValue: unknown;
|
|
32
|
+
newValue: unknown;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
declare type StringToAny = Record<string, any>;
|
|
36
|
+
|
|
37
|
+
declare type StringToString = Record<string, string>;
|
|
38
|
+
|
|
39
|
+
export declare abstract class Wrec extends HTMLElementBase {
|
|
40
|
+
#private;
|
|
41
|
+
private static attrToPropMap;
|
|
42
|
+
private static propToAttrMap;
|
|
43
|
+
static context: {};
|
|
44
|
+
static css: string;
|
|
45
|
+
private static elementName;
|
|
46
|
+
static formAssociated: boolean;
|
|
47
|
+
static html: string;
|
|
48
|
+
static properties: Record<string, PropertyConfig>;
|
|
49
|
+
private static propToComputedMap;
|
|
50
|
+
private static methodToExprsMap;
|
|
51
|
+
private static propToExprsMap;
|
|
52
|
+
private static template;
|
|
53
|
+
[key: string]: any;
|
|
54
|
+
static define(elementName: string): void;
|
|
55
|
+
constructor();
|
|
56
|
+
attributeChangedCallback(attrName: string, _oldValue: string | null, newValue: string | null): void;
|
|
57
|
+
batchSet(changes: StringToAny): void;
|
|
58
|
+
private static buildHTML;
|
|
59
|
+
changed(_statePath: string, componentProp: string, newValue: unknown): void;
|
|
60
|
+
connectedCallback(): Promise<void>;
|
|
61
|
+
disconnectedCallback(): void;
|
|
62
|
+
dispatch(name: string, detail: any): void;
|
|
63
|
+
displayIfSet(value: any, display?: string): string;
|
|
64
|
+
formAssociatedCallback(): void;
|
|
65
|
+
formResetCallback(): void;
|
|
66
|
+
private static getAttrName;
|
|
67
|
+
static getPropName(attrName: string): string;
|
|
68
|
+
static get observedAttributes(): string[];
|
|
69
|
+
propertyChangedCallback(_propName: string, _oldValue: unknown, _newValue: unknown): void;
|
|
70
|
+
ready(): void;
|
|
71
|
+
setAttributeSafe(name: string, value: string): void;
|
|
72
|
+
setFormValue(propName: string, value: string): void;
|
|
73
|
+
static ssr(properties?: StringToAny): string;
|
|
74
|
+
/**
|
|
75
|
+
* @param state - WrecState object
|
|
76
|
+
* @param map - object whose keys are state properties and
|
|
77
|
+
* whose values are component properties
|
|
78
|
+
*/
|
|
79
|
+
useState(state: WrecState, map?: StringToString): void;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export declare class WrecState {
|
|
83
|
+
#private;
|
|
84
|
+
static get(name: string): WrecState | undefined;
|
|
85
|
+
[key: string]: unknown;
|
|
86
|
+
constructor(name: string, persist: boolean, initial?: LooseObject);
|
|
87
|
+
subscribe(callback: ChangeCallback, paths?: string[]): () => void;
|
|
88
|
+
addProperty(propName: string, initialValue: unknown): void;
|
|
89
|
+
get id(): symbol;
|
|
90
|
+
log(): void;
|
|
91
|
+
}
|
|
92
|
+
|
|
1
93
|
export { }
|