assign-gingerly 0.0.53 → 0.0.55
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 +847 -5
- package/assignFrom.js +229 -9
- package/assignFrom.ts +338 -9
- package/assignGingerly.js +34 -1
- package/assignGingerly.ts +54 -1
- package/beVigilant.js +73 -0
- package/beVigilant.ts +85 -0
- package/enhanceAll.js +106 -0
- package/enhanceAll.ts +138 -0
- package/handlers/join.js +74 -0
- package/handlers/join.ts +80 -0
- package/handlers/lazyLoad.js +212 -0
- package/handlers/lazyLoad.ts +307 -0
- package/handlers/lazyLoadSwitch.js +58 -0
- package/handlers/lazyLoadSwitch.ts +63 -0
- package/handlers/microDataJoin.js +184 -0
- package/handlers/microDataJoin.ts +270 -0
- package/inferencer/.gitmodules +3 -0
- package/inferencer/.vscode/settings.json +2 -0
- package/inferencer/InferencedPropagator.js +230 -0
- package/inferencer/InferencedPropagator.ts +269 -0
- package/inferencer/LICENSE +21 -0
- package/inferencer/README.md +524 -0
- package/inferencer/Requirements/SupportForPropagator.md +368 -0
- package/inferencer/imports.html +7 -0
- package/inferencer/inferencer.js +254 -0
- package/inferencer/inferencer.ts +292 -0
- package/inferencer/package-lock.json +129 -0
- package/inferencer/package.json +60 -0
- package/inferencer/playwright-report/data/507ad515125e13390ea07de92f22331c913fa068.md +55 -0
- package/inferencer/playwright-report/index.html +90 -0
- package/inferencer/playwright.config.ts +54 -0
- package/inferencer/test-results/.last-run.json +6 -0
- package/inferencer/test-results/inferencer-Inferencer-Enha-535bc-inferencer-tests-in-browser-chromium/error-context.md +55 -0
- package/inferencer/tests/inferencedPropagator.html +428 -0
- package/inferencer/tests/inferencedPropagator.spec.ts +18 -0
- package/inferencer/tests/inferencer.html +355 -0
- package/inferencer/tests/inferencer.spec.ts +19 -0
- package/inferencer/tsconfig.json +19 -0
- package/inferencer/types/.kiro/specs/conversion-template/README.md +128 -0
- package/inferencer/types/.kiro/specs/conversion-template/design.md +360 -0
- package/inferencer/types/.kiro/specs/conversion-template/requirements.md +191 -0
- package/inferencer/types/.kiro/specs/conversion-template/tasks.md +174 -0
- package/inferencer/types/.kiro/steering/coding-standards.md +53 -0
- package/inferencer/types/.kiro/steering/conversion-guide.md +108 -0
- package/inferencer/types/.kiro/steering/declarative-configuration.md +108 -0
- package/inferencer/types/.kiro/steering/emc-json-serializability.md +306 -0
- package/inferencer/types/EnhancementConversionInstructions.md +1854 -0
- package/inferencer/types/LICENSE +21 -0
- package/inferencer/types/NewCustomElement.md +388 -0
- package/inferencer/types/NewCustomElementFeature.md +683 -0
- package/inferencer/types/NewEnhancementInstructions.md +705 -0
- package/inferencer/types/README.md +2 -0
- package/inferencer/types/agrace/types.d.ts +11 -0
- package/inferencer/types/assign-gingerly/types.d.ts +572 -0
- package/inferencer/types/be-a-beacon/types.d.ts +17 -0
- package/inferencer/types/be-bound/types.d.ts +66 -0
- package/inferencer/types/be-buttoned-up/types.d.ts +19 -0
- package/inferencer/types/be-calculating/types.d.ts +54 -0
- package/inferencer/types/be-clonable/types.d.ts +38 -0
- package/inferencer/types/be-committed/types.d.ts +22 -0
- package/inferencer/types/be-consoling/types.d.ts +24 -0
- package/inferencer/types/be-decked-with/types.d.ts +26 -0
- package/inferencer/types/be-delible/types.d.ts +27 -0
- package/inferencer/types/be-dispatching/types.d.ts +34 -0
- package/inferencer/types/be-evanescent/types.d.ts +20 -0
- package/inferencer/types/be-flashy/types.d.ts +21 -0
- package/inferencer/types/be-gone/types.d.ts +25 -0
- package/inferencer/types/be-observing/types.d.ts +55 -0
- package/inferencer/types/be-reflective/types.d.ts +78 -0
- package/inferencer/types/be-reformable/types.d.ts +49 -0
- package/inferencer/types/be-render-neutral/types.d.ts +32 -0
- package/inferencer/types/be-switched/types.d.ts +146 -0
- package/inferencer/types/be-typed/types.d.ts +32 -0
- package/inferencer/types/be-valued/types.d.ts +22 -0
- package/inferencer/types/data-props/types.d.ts +34 -0
- package/inferencer/types/do-inc/types.d.ts +56 -0
- package/inferencer/types/do-invoke/types.d.ts +38 -0
- package/inferencer/types/do-merge/types.d.ts +28 -0
- package/inferencer/types/do-toggle/types.d.ts +31 -0
- package/inferencer/types/face-up/types.d.ts +100 -0
- package/inferencer/types/fetch-for/types.d.ts +36 -0
- package/inferencer/types/folder-picker/types.d.ts +21 -0
- package/inferencer/types/global.d.ts +29 -0
- package/inferencer/types/id-generation/types.d.ts +26 -0
- package/inferencer/types/inferencer/types.d.ts +46 -0
- package/inferencer/types/mount-observer/types.d.ts +363 -0
- package/inferencer/types/nested-regex-groups/types.d.ts +107 -0
- package/inferencer/types/pipe-in/types.d.ts +52 -0
- package/inferencer/types/roundabout/types.d.ts +268 -0
- package/inferencer/types/soak-up/types.d.ts +40 -0
- package/inferencer/types/templ-maker/types.d.ts +43 -0
- package/inferencer/types/time-ticker/types.d.ts +62 -0
- package/inferencer/types/truth-sourcer/types.d.ts +44 -0
- package/inferencer/upSearch.js +27 -0
- package/inferencer/upSearch.ts +26 -0
- package/inferencer/withScopePerimeter.js +27 -0
- package/inferencer/withScopePerimeter.ts +33 -0
- package/inferredAssignments.js +38 -0
- package/inferredAssignments.ts +65 -0
- package/isAllowedImportPath.js +42 -0
- package/isAllowedImportPath.ts +53 -0
- package/package.json +57 -3
- package/paths.js +231 -0
- package/paths.ts +413 -0
- package/processHandlerCommands.js +188 -0
- package/processHandlerCommands.ts +217 -0
- package/resolveIdRef.js +144 -0
- package/resolveIdRef.ts +170 -0
- package/resolveValues.js +41 -2
- package/resolveValues.ts +41 -1
- package/transitionHelper.js +109 -0
- package/transitionHelper.ts +132 -0
- package/types/assign-gingerly/types.d.ts +89 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ElementEnhancementGateway, SpawnContext } from "../assign-gingerly/types";
|
|
2
|
+
|
|
3
|
+
export interface EndUserProps{
|
|
4
|
+
on: string[];
|
|
5
|
+
props: string[];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface AllProps extends EndUserProps{
|
|
9
|
+
enhancedElement: Element;
|
|
10
|
+
resolved: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type AP = AllProps;
|
|
14
|
+
|
|
15
|
+
export type PAP = Partial<AP>;
|
|
16
|
+
|
|
17
|
+
export type ProPAP = Promise<PAP>;
|
|
18
|
+
|
|
19
|
+
export interface Actions{
|
|
20
|
+
hydrate(self: AP): ProPAP;
|
|
21
|
+
init(self: AP, enhancedElement: Element, ctx: SpawnContext, initVals: PAP): Promise<void>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { StatementsResult } from "../nested-regex-groups/types";
|
|
2
|
+
import { ElementEnhancementGateway, SpawnContext } from "../assign-gingerly/types";
|
|
3
|
+
|
|
4
|
+
export interface RemoteSpecifier {
|
|
5
|
+
id?: string;
|
|
6
|
+
prop?: string;
|
|
7
|
+
path?: string;
|
|
8
|
+
evtName?: string;
|
|
9
|
+
as?: 'number' | 'boolean' | 'string' | 'object';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface DataPropsParameters {
|
|
13
|
+
remoteSpecifiers: Array<RemoteSpecifier>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface EndUserProps {
|
|
17
|
+
parsedStatements: StatementsResult<DataPropsParameters>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface AllProps extends EndUserProps {
|
|
21
|
+
enhancedElement: Element;
|
|
22
|
+
resolved: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type AP = AllProps;
|
|
26
|
+
|
|
27
|
+
export type PAP = Partial<AP>;
|
|
28
|
+
|
|
29
|
+
export type ProPAP = Promise<PAP>;
|
|
30
|
+
|
|
31
|
+
export interface Actions {
|
|
32
|
+
init(self: AP, enhancedElement: Element & ElementEnhancementGateway, ctx: SpawnContext, initVals: PAP): Promise<void>;
|
|
33
|
+
hydrate(self: AP): ProPAP;
|
|
34
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ElementEnhancementGateway, SpawnContext } from "../assign-gingerly/types";
|
|
2
|
+
import { StatementsResult } from "../nested-regex-groups/types";
|
|
3
|
+
|
|
4
|
+
export interface EndUserProps{
|
|
5
|
+
parsedStatements: StatementsResult<IncParameters>,
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface AllProps extends EndUserProps{
|
|
9
|
+
enhancedElement: Element & ElementEnhancementGateway;
|
|
10
|
+
resolved: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type AP = AllProps;
|
|
14
|
+
|
|
15
|
+
export type PAP = Partial<AP>;
|
|
16
|
+
|
|
17
|
+
export type ProPAP = Promise<PAP>
|
|
18
|
+
|
|
19
|
+
export interface Actions{
|
|
20
|
+
hydrate(self: AP & Actions): ProPAP;
|
|
21
|
+
handleEvent(self: AP, event: Event, incParameters: IncParameters): void;
|
|
22
|
+
init(self: AP, enhancedElement: Element, ctx: SpawnContext, initVals: PAP): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type asOptions =
|
|
26
|
+
| 'number'
|
|
27
|
+
| 'boolean'
|
|
28
|
+
| 'string'
|
|
29
|
+
| 'object'
|
|
30
|
+
| 'regexp'
|
|
31
|
+
| 'urlpattern'
|
|
32
|
+
| 'boolean|number'
|
|
33
|
+
;
|
|
34
|
+
|
|
35
|
+
export type SubPropPath = string;
|
|
36
|
+
export type EventName = string;
|
|
37
|
+
|
|
38
|
+
// export interface Specifier {
|
|
39
|
+
// id?: string,
|
|
40
|
+
// prop?: string,
|
|
41
|
+
// path?: SubPropPath,
|
|
42
|
+
// evtName?: EventName,
|
|
43
|
+
// as?: asOptions,
|
|
44
|
+
// constVal?: any;
|
|
45
|
+
// enhKey?: string;
|
|
46
|
+
// ish?: boolean;
|
|
47
|
+
// host?: boolean;
|
|
48
|
+
// }
|
|
49
|
+
|
|
50
|
+
export interface IncParameters {
|
|
51
|
+
prop?: string | null,
|
|
52
|
+
byAmtS?: string,
|
|
53
|
+
byAmtN?: number,
|
|
54
|
+
targetElementId?: string,
|
|
55
|
+
localEventType?: string,
|
|
56
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ElementEnhancementGateway, SpawnContext } from "../assign-gingerly/types";
|
|
2
|
+
import { StatementsResult } from "../nested-regex-groups/types";
|
|
3
|
+
|
|
4
|
+
export interface Specifier {
|
|
5
|
+
selector?: string;
|
|
6
|
+
prop?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface EndUserProps{
|
|
10
|
+
invokeParamSet: StatementsResult<InvokingParameters>,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface AllProps extends EndUserProps{
|
|
14
|
+
enhancedElement: Element & ElementEnhancementGateway;
|
|
15
|
+
resolved: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type AP = AllProps;
|
|
19
|
+
|
|
20
|
+
export type PAP = Partial<AP>;
|
|
21
|
+
|
|
22
|
+
export type ProPAP = Promise<PAP>
|
|
23
|
+
|
|
24
|
+
export interface Actions{
|
|
25
|
+
hydrate(self: AP): ProPAP;
|
|
26
|
+
init(self: AP, enhancedElement: Element, ctx: SpawnContext, initVals: PAP): Promise<void>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
export interface InvokingParameters {
|
|
32
|
+
targetSpecifier: {
|
|
33
|
+
hostOrPeerMethodName: string,
|
|
34
|
+
targetElementId?: string,
|
|
35
|
+
},
|
|
36
|
+
//defaults to "click" if not specified
|
|
37
|
+
localEventType: string,
|
|
38
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ElementEnhancementGateway, SpawnContext, IAssignGingerlyOptions } from "../assign-gingerly/types";
|
|
2
|
+
|
|
3
|
+
export interface MergeParameters {
|
|
4
|
+
assign: Record<string, any>;
|
|
5
|
+
on?: string;
|
|
6
|
+
options?: IAssignGingerlyOptions;
|
|
7
|
+
targetElementId?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface EndUserProps {
|
|
11
|
+
mergeParamSets: MergeParameters | MergeParameters[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface AllProps extends EndUserProps {
|
|
15
|
+
enhancedElement: Element & ElementEnhancementGateway;
|
|
16
|
+
resolved: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type AP = AllProps;
|
|
20
|
+
|
|
21
|
+
export type PAP = Partial<AP>;
|
|
22
|
+
|
|
23
|
+
export type ProPAP = Promise<PAP>;
|
|
24
|
+
|
|
25
|
+
export interface Actions {
|
|
26
|
+
init(self: AP, enhancedElement: Element, ctx: SpawnContext, initVals: PAP): Promise<void>;
|
|
27
|
+
hydrate(self: AP): ProPAP;
|
|
28
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ElementEnhancementGateway, SpawnContext } from "../assign-gingerly/types";
|
|
2
|
+
import { StatementsResult } from "../nested-regex-groups/types";
|
|
3
|
+
|
|
4
|
+
export interface EndUserProps{}
|
|
5
|
+
|
|
6
|
+
export interface AllProps extends EndUserProps{
|
|
7
|
+
enhancedElement: Element & ElementEnhancementGateway;
|
|
8
|
+
parsedStatements: StatementsResult<TogglingParameters>;
|
|
9
|
+
resolved?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type AP = AllProps;
|
|
13
|
+
|
|
14
|
+
export type PAP = Partial<AP>;
|
|
15
|
+
|
|
16
|
+
export type ProPAP = Promise<PAP>
|
|
17
|
+
|
|
18
|
+
export interface Actions{
|
|
19
|
+
init(self: AllProps, enhancedElement: Element, ctx: SpawnContext, initVals: PAP): Promise<void>;
|
|
20
|
+
hydrate(self: AP): ProPAP;
|
|
21
|
+
handleEvent(self: AP, e: Event, parsedStatement: TogglingParameters): void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface TogglingParameters {
|
|
25
|
+
prop?: string | null;
|
|
26
|
+
localEventType?: string;
|
|
27
|
+
targetSpecifier: {
|
|
28
|
+
prop?: string;
|
|
29
|
+
targetElementId?: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared context passed via getSharedContext — contains the
|
|
3
|
+
* ElementInternals instance needed for form control APIs.
|
|
4
|
+
*/
|
|
5
|
+
export interface FaceUpSharedContext {
|
|
6
|
+
/** The ElementInternals instance for form control APIs */
|
|
7
|
+
internals: ElementInternals;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Context passed to the FaceUp feature constructor
|
|
12
|
+
*/
|
|
13
|
+
export interface FeatureSpawnContext {
|
|
14
|
+
key: string;
|
|
15
|
+
optIn: any;
|
|
16
|
+
injection: any;
|
|
17
|
+
featuresRegistry: any;
|
|
18
|
+
shared?: FaceUpSharedContext;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Validation flags matching the ValidityStateFlags interface.
|
|
23
|
+
* Used with setValidity() to indicate the type of validation error.
|
|
24
|
+
*/
|
|
25
|
+
export interface ValidationFlags {
|
|
26
|
+
valueMissing?: boolean;
|
|
27
|
+
typeMismatch?: boolean;
|
|
28
|
+
patternMismatch?: boolean;
|
|
29
|
+
tooLong?: boolean;
|
|
30
|
+
tooShort?: boolean;
|
|
31
|
+
rangeUnderflow?: boolean;
|
|
32
|
+
rangeOverflow?: boolean;
|
|
33
|
+
stepMismatch?: boolean;
|
|
34
|
+
badInput?: boolean;
|
|
35
|
+
customError?: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Properties that the FaceUp feature exposes.
|
|
40
|
+
* These allow the host custom element to participate in HTML forms
|
|
41
|
+
* via the ElementInternals API.
|
|
42
|
+
*
|
|
43
|
+
* Because the feature is installed as a getter-only property,
|
|
44
|
+
* assignGingerly merges directly into the instance. The consumer
|
|
45
|
+
* simply sets properties (e.g., el.faceUp.value = x) and the
|
|
46
|
+
* setters handle syncing to ElementInternals automatically.
|
|
47
|
+
*/
|
|
48
|
+
export interface FaceUpProps {
|
|
49
|
+
/**
|
|
50
|
+
* The current form value of the control.
|
|
51
|
+
* Setting this calls setFormValue() on the internals.
|
|
52
|
+
*/
|
|
53
|
+
value: string | File | FormData | null;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Internal state for form restoration (optional).
|
|
57
|
+
* If provided, passed as the second argument to setFormValue().
|
|
58
|
+
*/
|
|
59
|
+
state: string | File | FormData | null;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Whether the control is currently disabled.
|
|
63
|
+
*/
|
|
64
|
+
disabled: boolean;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Whether the control requires a value for form submission.
|
|
68
|
+
*/
|
|
69
|
+
required: boolean;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Custom validation message. Setting a non-empty string
|
|
73
|
+
* marks the control as invalid with customError.
|
|
74
|
+
*/
|
|
75
|
+
validationMessage: string;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Internal state
|
|
80
|
+
*/
|
|
81
|
+
export interface AllProps extends FaceUpProps {
|
|
82
|
+
/**
|
|
83
|
+
* WeakRef to the host custom element
|
|
84
|
+
*/
|
|
85
|
+
hostRef: WeakRef<HTMLElement> | null;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The ElementInternals instance from the host (for form control APIs)
|
|
89
|
+
*/
|
|
90
|
+
internals: ElementInternals | null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export type AP = AllProps;
|
|
94
|
+
export type PAP = Partial<AP>;
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
export interface CustomData {
|
|
99
|
+
integrateWithRoundabout: boolean;
|
|
100
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { StatementsResult } from "../nested-regex-groups/types";
|
|
2
|
+
import { ElementEnhancementGateway, SpawnContext } from "../assign-gingerly/types";
|
|
3
|
+
|
|
4
|
+
export interface FetchForParam {
|
|
5
|
+
remoteSpecifier: {
|
|
6
|
+
prop?: string;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface FetchReadyEvent {
|
|
12
|
+
url: string;
|
|
13
|
+
options?: RequestInit;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface EndUserProps {
|
|
17
|
+
fetchForParams: StatementsResult<FetchForParam>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface AllProps extends EndUserProps {
|
|
21
|
+
enhancedElement: Element;
|
|
22
|
+
fetchReadyEvent: FetchReadyEvent;
|
|
23
|
+
resolved: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type AP = AllProps;
|
|
27
|
+
|
|
28
|
+
export type PAP = Partial<AllProps>;
|
|
29
|
+
|
|
30
|
+
export type ProPAP = Promise<PAP>;
|
|
31
|
+
|
|
32
|
+
export interface Actions {
|
|
33
|
+
init(self: AP, enhancedElement: Element & ElementEnhancementGateway, ctx: SpawnContext, initVals: PAP): Promise<void>;
|
|
34
|
+
hydrate(self: AP): PAP;
|
|
35
|
+
doFetch(self: AP): Promise<void>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ElementEnhancementGateway, SpawnContext } from "../assign-gingerly/types";
|
|
2
|
+
|
|
3
|
+
export interface EndUserProps{
|
|
4
|
+
noNudge: boolean;
|
|
5
|
+
options: DirectoryPickerOptions;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface AllProps extends EndUserProps{
|
|
9
|
+
enhancedElement: Element;
|
|
10
|
+
directoryHandle: FileSystemDirectoryHandle | undefined;
|
|
11
|
+
resolved: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type AP = AllProps;
|
|
15
|
+
export type PAP = Partial<AP>;
|
|
16
|
+
export type ProPAP = Promise<PAP>;
|
|
17
|
+
|
|
18
|
+
export interface Actions{
|
|
19
|
+
init(self: AP, enhancedElement: Element & ElementEnhancementGateway, ctx: SpawnContext, initVals: PAP): Promise<void>;
|
|
20
|
+
hydrate(self: AP): ProPAP;
|
|
21
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Type declarations for Map.prototype.getOrInsertComputed and WeakMap.prototype.getOrInsertComputed
|
|
2
|
+
// Feature is now supported in all modern browsers (Chrome 146+, Firefox 134+, Safari 18.2+)
|
|
3
|
+
// See: https://web-platform-dx.github.io/web-features-explorer/features/getorinsert/
|
|
4
|
+
|
|
5
|
+
interface Map<K, V> {
|
|
6
|
+
/**
|
|
7
|
+
* Returns the value associated with the key if it exists, otherwise inserts
|
|
8
|
+
* the value returned by the insert callback and returns it.
|
|
9
|
+
* @param key The key to look up
|
|
10
|
+
* @param insert A callback that returns the value to insert if the key doesn't exist
|
|
11
|
+
* @returns The existing or newly inserted value
|
|
12
|
+
*/
|
|
13
|
+
getOrInsertComputed(key: K, insert: () => V): V;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface WeakMap<K extends object, V> {
|
|
17
|
+
/**
|
|
18
|
+
* Returns the value associated with the key if it exists, otherwise inserts
|
|
19
|
+
* the value returned by the insert callback and returns it.
|
|
20
|
+
* @param key The key to look up
|
|
21
|
+
* @param insert A callback that returns the value to insert if the key doesn't exist
|
|
22
|
+
* @returns The existing or newly inserted value
|
|
23
|
+
*/
|
|
24
|
+
getOrInsertComputed(key: K, insert: () => V): V;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface HTMLTemplateElement {
|
|
28
|
+
remoteContent?: Node;
|
|
29
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Type definitions for id-generation
|
|
2
|
+
|
|
3
|
+
export interface GenIdsOptions {
|
|
4
|
+
//startCounter?: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface ParsedDataId {
|
|
8
|
+
name: string;
|
|
9
|
+
setName: boolean;
|
|
10
|
+
setItemprop: boolean;
|
|
11
|
+
setClass: boolean;
|
|
12
|
+
setPart: boolean;
|
|
13
|
+
setItemscope: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ScopeInfo {
|
|
17
|
+
scopeElement: Element;
|
|
18
|
+
elementsToProcess: Element[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface AttributeReplacement {
|
|
22
|
+
element: Element;
|
|
23
|
+
attributeName: string;
|
|
24
|
+
oldValue: string;
|
|
25
|
+
newValue: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { EnhancementConfig } from "../assign-gingerly/types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Symbol for smart value assignment
|
|
5
|
+
*/
|
|
6
|
+
export declare const value: symbol;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Symbol for smart display assignment
|
|
10
|
+
*/
|
|
11
|
+
export declare const display: symbol;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Enhancement class that provides smart value and display property inference
|
|
15
|
+
*/
|
|
16
|
+
export declare class Infer<TValue = any, TDisplay = any> {
|
|
17
|
+
get enhancedElement(): Element;
|
|
18
|
+
constructor(enhancedElement?: Element);
|
|
19
|
+
get value(): TValue | undefined;
|
|
20
|
+
set value(nv: TValue);
|
|
21
|
+
get display(): TDisplay | undefined;
|
|
22
|
+
set display(nv: TDisplay);
|
|
23
|
+
get eventType(): string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Registry item for the Infer enhancement
|
|
28
|
+
*/
|
|
29
|
+
export declare const registryItem: EnhancementConfig;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Infer the most appropriate value property for an element
|
|
33
|
+
*/
|
|
34
|
+
export declare function inferValueProperty(element: Element): string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Infer the most appropriate display property for an element
|
|
38
|
+
*/
|
|
39
|
+
export declare function inferDisplayProperty(element: Element): string;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Infer the most appropriate event type for an element
|
|
43
|
+
*/
|
|
44
|
+
export declare function inferEventType(element: Element): string;
|
|
45
|
+
|
|
46
|
+
export default registryItem;
|