mount-observer 0.0.39 → 0.0.40
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/MountObserver.js +9 -2
- package/MountObserver.ts +11 -5
- package/README.md +82 -13
- package/package.json +2 -2
- package/ts-refs/be-a-beacon/types.d.ts +3 -2
- package/ts-refs/be-alit/types.d.ts +1 -0
- package/ts-refs/be-based/types.d.ts +32 -0
- package/ts-refs/be-bound/types.d.ts +0 -3
- package/ts-refs/be-buttoned-up/types.d.ts +21 -0
- package/ts-refs/be-calculating/types.d.ts +4 -0
- package/ts-refs/be-clonable/types.d.ts +28 -0
- package/ts-refs/be-delible/types.d.ts +26 -0
- package/ts-refs/be-elevating/types.d.ts +55 -0
- package/ts-refs/be-eventing/types.d.ts +27 -0
- package/ts-refs/be-formalizing/types.d.ts +29 -0
- package/ts-refs/be-formidable/types.d.ts +64 -0
- package/ts-refs/be-kvetching/types.d.ts +24 -0
- package/ts-refs/be-literate/types.d.ts +10 -2
- package/ts-refs/be-mediating/types.d.ts +34 -0
- package/ts-refs/be-methodical/types.d.ts +20 -0
- package/ts-refs/be-modding/types.d.ts +18 -0
- package/ts-refs/{be-observant → be-observing}/types.d.ts +7 -4
- package/ts-refs/be-parsed/types.d.ts +19 -0
- package/ts-refs/be-persistent/types.d.ts +66 -0
- package/ts-refs/be-reformable/types.d.ts +48 -0
- package/ts-refs/be-render-neutral/types.d.ts +29 -0
- package/ts-refs/be-switched/types.d.ts +12 -13
- package/ts-refs/be-typed/types.d.ts +36 -0
- package/ts-refs/be-written/types.d.ts +37 -0
- package/ts-refs/for-fetch/types.d.ts +175 -0
- package/ts-refs/mount-observer/types.d.ts +6 -1
- package/ts-refs/trans-render/XV/types.d.ts +69 -0
- package/ts-refs/trans-render/asmr/types.d.ts +130 -0
- package/ts-refs/trans-render/be/types.d.ts +188 -0
- package/ts-refs/trans-render/dss/types.d.ts +159 -0
- package/ts-refs/trans-render/froop/types.d.ts +452 -0
- package/ts-refs/trans-render/funions/types.d.ts +12 -0
- package/ts-refs/trans-render/lib/mixins/types.d.ts +42 -0
- package/ts-refs/trans-render/lib/prs/types.d.ts +39 -0
- package/ts-refs/trans-render/lib/types.d.ts +489 -0
- package/ts-refs/trans-render/types.d.ts +3 -0
- package/ts-refs/xtal-element/types.d.ts +42 -0
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import {IEnhancement, BEAllProps} from '../trans-render/be/types';
|
|
2
|
+
import {USL} from '../trans-render/XV/types'
|
|
2
3
|
|
|
3
4
|
export interface EndUserProps extends IEnhancement<HTMLInputElement>{
|
|
4
5
|
readVerb: 'readAsText' | 'readAsDataURL' | 'readAsArrayBuffer' | 'readAsBinaryString';
|
|
6
|
+
writeTo: USL;
|
|
5
7
|
}
|
|
6
8
|
|
|
9
|
+
export type FileAndContents = [File, any];
|
|
10
|
+
|
|
7
11
|
export interface AllProps extends EndUserProps{
|
|
8
|
-
fileContents:
|
|
12
|
+
fileContents: Array<FileAndContents>;
|
|
13
|
+
writtenTo: Array<USL>;
|
|
9
14
|
}
|
|
10
15
|
|
|
11
16
|
|
|
@@ -15,7 +20,10 @@ export type PAP = Partial<AP>;
|
|
|
15
20
|
|
|
16
21
|
export type ProPAP = Promise<PAP>;
|
|
17
22
|
|
|
23
|
+
export type BAP = AP & BEAllProps;
|
|
24
|
+
|
|
18
25
|
|
|
19
26
|
export interface Actions {
|
|
20
|
-
hydrate(self:
|
|
27
|
+
hydrate(self: BAP): ProPAP,
|
|
28
|
+
storeFileContents(self: BAP): ProPAP,
|
|
21
29
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {IEnhancement, BEAllProps} from '../trans-render/be/types';
|
|
2
|
+
import {Specifier} from '../trans-render/dss/types';
|
|
3
|
+
import { CSSQuery } from '../trans-render/types';
|
|
4
|
+
|
|
5
|
+
export interface EndUserProps extends IEnhancement{
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface AllProps extends EndUserProps{
|
|
9
|
+
parsedStatements: Array<MediatingParams>,
|
|
10
|
+
rawStatements?: Array<string>,
|
|
11
|
+
mediator?: (x: any) => any,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type AP = AllProps;
|
|
15
|
+
|
|
16
|
+
export type PAP = Partial<AP>;
|
|
17
|
+
|
|
18
|
+
export type ProPAP = Promise<PAP>;
|
|
19
|
+
|
|
20
|
+
export type BAP = AP & BEAllProps;
|
|
21
|
+
|
|
22
|
+
export interface Actions{
|
|
23
|
+
warn(...data: any[]): void;
|
|
24
|
+
parseJS(self: BAP): ProPAP;
|
|
25
|
+
hydrate(self: BAP): ProPAP;
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface MediatingParams{
|
|
30
|
+
originPart: string,
|
|
31
|
+
targetPart: string,
|
|
32
|
+
originSpecifiers: Array<Specifier>,
|
|
33
|
+
targetCSS: CSSQuery,
|
|
34
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {IEnhancement, BEAllProps} from '../trans-render/be/types';
|
|
2
|
+
|
|
3
|
+
export interface EndUserProps extends IEnhancement{
|
|
4
|
+
ceName: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface AllProps extends EndUserProps{}
|
|
8
|
+
|
|
9
|
+
export type AP = AllProps;
|
|
10
|
+
|
|
11
|
+
export type PAP = Partial<AP>;
|
|
12
|
+
|
|
13
|
+
export type ProPAP = Promise<PAP>;
|
|
14
|
+
|
|
15
|
+
export type BAP = AP & BEAllProps;
|
|
16
|
+
|
|
17
|
+
export interface Actions{
|
|
18
|
+
hydrate(self: BAP): ProPAP;
|
|
19
|
+
}
|
|
20
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {IEnhancement, BEAllProps} from '../trans-render/be/types';
|
|
2
|
+
|
|
3
|
+
export interface EndUserProps extends IEnhancement{
|
|
4
|
+
jsExpr: string;
|
|
5
|
+
}
|
|
6
|
+
export interface AllProps extends EndUserProps{}
|
|
7
|
+
|
|
8
|
+
export type AP = AllProps;
|
|
9
|
+
|
|
10
|
+
export type PAP = Partial<AP>;
|
|
11
|
+
|
|
12
|
+
export type ProPAP = Promise<PAP>;
|
|
13
|
+
|
|
14
|
+
export type BAP = AP & BEAllProps;
|
|
15
|
+
|
|
16
|
+
export interface Actions{
|
|
17
|
+
processJS(self: BAP): ProPAP;
|
|
18
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {BEAllProps, IEnhancement} from '../trans-render/be/types';
|
|
1
|
+
import {BEAllProps, EnhancementInfo, IEnhancement, IW} from '../trans-render/be/types';
|
|
2
2
|
import { Specifier } from "../trans-render/dss/types";
|
|
3
3
|
import {aggKeys, Handlers} from '../be-hive/types';
|
|
4
4
|
import { StringWithAutocompleteOptions } from '../trans-render/types';
|
|
@@ -8,12 +8,12 @@ export interface EndUserProps extends IEnhancement{
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export interface AllProps extends EndUserProps{
|
|
11
|
-
//observedFactors?: Array<Specifier>,
|
|
12
11
|
parsedStatements: Array<ObservingParameters>,
|
|
13
|
-
//bindings?: Array<EndPoints>,
|
|
14
12
|
rawStatements?: Array<string>,
|
|
15
13
|
didInferring?: boolean,
|
|
16
|
-
|
|
14
|
+
ws?: Array<IW>,
|
|
15
|
+
//enhancementInfo: EnhancementInfo,
|
|
16
|
+
enhKey: string,
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
|
|
@@ -43,8 +43,11 @@ export interface AndIfThen{
|
|
|
43
43
|
export interface ObservingParameters{
|
|
44
44
|
localPropToSet?: string,
|
|
45
45
|
remoteSpecifiers: Array<Specifier>,
|
|
46
|
+
punt: boolean,
|
|
46
47
|
mappings?: Array<AndIfThen>,
|
|
47
48
|
aggKey: StringWithAutocompleteOptions<aggKeys>,
|
|
49
|
+
JSExpr: string,
|
|
50
|
+
ONExpr: string,
|
|
48
51
|
//aggregateRemoteVals?: 'Union' | 'Conjunction' | 'ObjectAssign' | 'Sum' | 'Product' | 'ArrayPush'
|
|
49
52
|
}
|
|
50
53
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {IEnhancement, BEAllProps} from '../trans-render/be/types';
|
|
2
|
+
|
|
3
|
+
export interface EndUserProps extends IEnhancement<HTMLScriptElement>{
|
|
4
|
+
|
|
5
|
+
}
|
|
6
|
+
export interface AllProps extends EndUserProps{
|
|
7
|
+
value: any,
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type AP = AllProps;
|
|
11
|
+
|
|
12
|
+
export type PAP = Partial<AP>;
|
|
13
|
+
|
|
14
|
+
export type ProPAP = Promise<PAP>;
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
export interface Actions{
|
|
18
|
+
|
|
19
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {IEnhancement, BEAllProps} from '../trans-render/be/types';
|
|
2
|
+
import { USL } from '../trans-render/XV/types';
|
|
3
|
+
|
|
4
|
+
export interface EndUserProps extends IEnhancement {
|
|
5
|
+
//params?: PersistenceParams | Array<PersistenceParams>;
|
|
6
|
+
rules: Array<PersistenceRule>
|
|
7
|
+
}
|
|
8
|
+
export interface AllProps extends EndUserProps{
|
|
9
|
+
noAttrs: boolean,
|
|
10
|
+
//isParsed?: boolean,
|
|
11
|
+
//persistenceParams?: Array<PersistenceParams>
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export type AP = AllProps;
|
|
16
|
+
|
|
17
|
+
export type PAP = Partial<AP>;
|
|
18
|
+
|
|
19
|
+
export type ProPAP = Promise<PAP>;
|
|
20
|
+
|
|
21
|
+
export type BAP = AP & BEAllProps;
|
|
22
|
+
|
|
23
|
+
export interface Actions{
|
|
24
|
+
|
|
25
|
+
hydrate(self: BAP): ProPAP;
|
|
26
|
+
noAttrs(self: BAP): ProPAP;
|
|
27
|
+
// parameterize(self: this): ProPAP
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface PersistenceRule {
|
|
31
|
+
localProp?: string,
|
|
32
|
+
localEvent?: string,
|
|
33
|
+
usl?: USL,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// export interface PersistenceParams<TObjectToPersist = any, TEventMap = any>{
|
|
37
|
+
// what?: {[key in keyof TObjectToPersist]: boolean | string | WhatToPersistCriteria},
|
|
38
|
+
// where: PersistenceStorage,
|
|
39
|
+
// when?: {[key in keyof TEventMap]: boolean | EventCriteria},
|
|
40
|
+
// nudge?: boolean,
|
|
41
|
+
// persistOnUnload?: boolean,
|
|
42
|
+
// restoreIf: RestoreCriteria,
|
|
43
|
+
// eventToFire?: {
|
|
44
|
+
// type: string,
|
|
45
|
+
// bubbles: boolean,
|
|
46
|
+
// cancelable: boolean,
|
|
47
|
+
// composed: boolean,
|
|
48
|
+
// }
|
|
49
|
+
// }
|
|
50
|
+
|
|
51
|
+
// export interface PersistenceStorage{
|
|
52
|
+
// sessionStorage?: boolean,
|
|
53
|
+
// idb?: boolean,
|
|
54
|
+
// autoGenId?: boolean,
|
|
55
|
+
// hash?: boolean,
|
|
56
|
+
// }
|
|
57
|
+
|
|
58
|
+
// export interface EventCriteria{}
|
|
59
|
+
|
|
60
|
+
// export interface RestoreCriteria{
|
|
61
|
+
// always?: boolean,
|
|
62
|
+
// }
|
|
63
|
+
|
|
64
|
+
// export interface WhatToPersistCriteria {
|
|
65
|
+
// //beBeatified: boolean
|
|
66
|
+
// }
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {BEAllProps, IEnhancement} from '../trans-render/be/types';
|
|
2
|
+
import {Specifier, DSS} from '../trans-render/dss/types';
|
|
3
|
+
|
|
4
|
+
export interface EndUserProps extends IEnhancement<HTMLFormElement>{
|
|
5
|
+
baseLink: string,
|
|
6
|
+
baseURL: string,
|
|
7
|
+
path: string,
|
|
8
|
+
headers: HeadersInit | undefined,
|
|
9
|
+
updateOn: 'input' | 'change' | 'submit',
|
|
10
|
+
submitOptions:{
|
|
11
|
+
onlyAfter: Specifier,
|
|
12
|
+
nudges: boolean,
|
|
13
|
+
disableIfNotAllConditionsAreMet: boolean
|
|
14
|
+
},
|
|
15
|
+
headerFields: Array<DSS>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type BeforeToken = string;
|
|
19
|
+
type TokenKey = string | undefined
|
|
20
|
+
|
|
21
|
+
export interface IURLBuilder{
|
|
22
|
+
readonly tokens: Array<[BeforeToken, TokenKey]>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface AllProps extends EndUserProps{
|
|
26
|
+
updateCnt: number,
|
|
27
|
+
readonly urlBuilder: IURLBuilder,
|
|
28
|
+
readonly resolvedBaseURL: true,
|
|
29
|
+
readonly fetchOptions: RequestInit,
|
|
30
|
+
readonly isFetchReady: boolean,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type AP = AllProps;
|
|
34
|
+
|
|
35
|
+
export type PAP = Partial<AP>;
|
|
36
|
+
|
|
37
|
+
export type ProPAP = Promise<PAP>;
|
|
38
|
+
|
|
39
|
+
export type BAP = AP & BEAllProps;
|
|
40
|
+
|
|
41
|
+
export interface Actions {
|
|
42
|
+
resolveBaseLink(self: BAP): PAP;
|
|
43
|
+
specifyDefaultBaseURL(self: BAP): PAP;
|
|
44
|
+
hydrate(self: BAP): ProPAP;
|
|
45
|
+
updateAction(self: BAP): ProPAP;
|
|
46
|
+
parsePath(self: BAP): ProPAP;
|
|
47
|
+
suggestFetch(self: BAP): PAP;
|
|
48
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {BEAllProps, IEnhancement} from '../trans-render/be/types';
|
|
2
|
+
import {AbsorbingObject} from '../trans-render/asmr/types';
|
|
3
|
+
|
|
4
|
+
export interface RenderingHTMLScriptElement extends HTMLScriptElement{
|
|
5
|
+
renderer: (vm: any, html: any) => any,
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface EndUserProps extends IEnhancement<RenderingHTMLScriptElement>{
|
|
9
|
+
vm: any,
|
|
10
|
+
with: Array<string>,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface AP extends EndUserProps{
|
|
14
|
+
renderer: (vm: any, html: any) => any,
|
|
15
|
+
absorbingObject: AbsorbingObject
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type PAP = Partial<AP>;
|
|
19
|
+
|
|
20
|
+
export type BAP = AP & BEAllProps;
|
|
21
|
+
|
|
22
|
+
export type ProPAP = Promise<PAP>;
|
|
23
|
+
|
|
24
|
+
export interface Actions {
|
|
25
|
+
getRenderer(self: BAP): BAP;
|
|
26
|
+
doRender(self: BAP): void;
|
|
27
|
+
observe(self: BAP): ProPAP;
|
|
28
|
+
absorb(self: BAP, e?: Event): ProPAP;
|
|
29
|
+
}
|
|
@@ -25,10 +25,7 @@ export interface EndUserProps extends IEnhancement<HTMLTemplateElement>{
|
|
|
25
25
|
* Works with beOosoom decorator, so becomes inert when out of view
|
|
26
26
|
*/
|
|
27
27
|
beOosoom?: string;
|
|
28
|
-
|
|
29
|
-
// on?: Array<SwitchStatement>;
|
|
30
|
-
// Off?: Array<SwitchStatement>;
|
|
31
|
-
// off?: Array<SwitchStatement>;
|
|
28
|
+
js?: string;
|
|
32
29
|
}
|
|
33
30
|
|
|
34
31
|
export interface AllProps extends EndUserProps{
|
|
@@ -43,7 +40,8 @@ export interface AllProps extends EndUserProps{
|
|
|
43
40
|
twoValueSwitches: Array<TwoValueSwitch>,
|
|
44
41
|
offBinarySwitches?: Array<OneValueSwitch>,
|
|
45
42
|
nValueSwitches?: Array<NValueScriptSwitch>
|
|
46
|
-
rawStatements?: Array<string
|
|
43
|
+
rawStatements?: Array<string>,
|
|
44
|
+
notProcessedJS?: boolean,
|
|
47
45
|
}
|
|
48
46
|
|
|
49
47
|
export type SwitchStatement = string;
|
|
@@ -97,18 +95,19 @@ export type ProPAP = Promise<PAP>;
|
|
|
97
95
|
export type BAP = AP & BEAllProps;
|
|
98
96
|
|
|
99
97
|
export interface Actions{
|
|
100
|
-
calcSwitchesSatisfied(self:
|
|
101
|
-
calcVal(self:
|
|
102
|
-
onTrue(self:
|
|
103
|
-
onFalse(self:
|
|
98
|
+
calcSwitchesSatisfied(self: BAP): PAP;
|
|
99
|
+
calcVal(self: BAP): PAP;
|
|
100
|
+
onTrue(self: BAP): Promise<void>;
|
|
101
|
+
onFalse(self: BAP): Promise<void>;
|
|
104
102
|
// addMediaListener(self: this): POA;
|
|
105
103
|
// chkMedia(self: this, e: MediaQueryListEvent): PAP;
|
|
106
104
|
|
|
107
105
|
// doOnBinarySwitches(self: this): Promise<void>;
|
|
108
|
-
onSingleValSwitches(self:
|
|
109
|
-
onTwoValSwitches(self:
|
|
110
|
-
onNValSwitches(self:
|
|
111
|
-
onRawStatements(self:
|
|
106
|
+
onSingleValSwitches(self: BAP): Promise<void>;
|
|
107
|
+
onTwoValSwitches(self: BAP): Promise<void>;
|
|
108
|
+
onNValSwitches(self: BAP): Promise<void>;
|
|
109
|
+
onRawStatements(self: BAP): void;
|
|
110
|
+
processJS(self: BAP): ProPAP;
|
|
112
111
|
}
|
|
113
112
|
|
|
114
113
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {BEAllProps, IEnhancement} from '../trans-render/be/types';
|
|
2
|
+
|
|
3
|
+
export interface EndUserProps extends IEnhancement<HTMLLabelElement> {
|
|
4
|
+
triggerInsertPosition: InsertPosition;
|
|
5
|
+
labelTextContainer: string;
|
|
6
|
+
buttonContent: string;
|
|
7
|
+
nudge?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface AllProps extends EndUserProps{
|
|
11
|
+
byob?: boolean;
|
|
12
|
+
trigger: WeakRef<HTMLButtonElement>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type AP = AllProps;
|
|
16
|
+
|
|
17
|
+
export type PAP = Partial<AP>;
|
|
18
|
+
|
|
19
|
+
export type BAP = AP & BEAllProps
|
|
20
|
+
|
|
21
|
+
export type ProPAP = Promise<PAP>;
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
export interface Actions{
|
|
26
|
+
addTypeBtn(self: BAP): ProPAP;
|
|
27
|
+
setBtnContent(self: BAP): void;
|
|
28
|
+
openDialog(self: BAP): Promise<void>
|
|
29
|
+
// beTyped(self: this): void;
|
|
30
|
+
// finale(): void;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface ITyper{
|
|
34
|
+
showDialog(): void;
|
|
35
|
+
dispose(): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {IEnhancement, BEAllProps} from '../trans-render/be/types';
|
|
2
|
+
import {EndUserProps as BeBasedEndUserProps} from '../be-based/types';
|
|
3
|
+
import {Inserts} from '../../node_modules/stream-orator/types';
|
|
4
|
+
|
|
5
|
+
export interface EndUserProps extends IEnhancement{
|
|
6
|
+
from?: string,
|
|
7
|
+
to?: string,
|
|
8
|
+
shadowRootMode?: 'open' | 'closed',
|
|
9
|
+
encoding?: 'UTF-8' | 'UTF-16'
|
|
10
|
+
reqInit?: RequestInit,
|
|
11
|
+
wrapper?: string,
|
|
12
|
+
beBased?: boolean | BeBasedEndUserProps,
|
|
13
|
+
beOosoom?: string,
|
|
14
|
+
defer?: boolean,
|
|
15
|
+
inProgressCss?: string,
|
|
16
|
+
inserts?:Inserts,
|
|
17
|
+
between?: [lhs: string, rhs: string],
|
|
18
|
+
once?: boolean,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface AllProps extends EndUserProps{
|
|
22
|
+
to: string,
|
|
23
|
+
from: string,
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface AllProps extends EndUserProps {}
|
|
27
|
+
|
|
28
|
+
export type AP = AllProps;
|
|
29
|
+
|
|
30
|
+
export type PAP = Partial<AP>;
|
|
31
|
+
|
|
32
|
+
export type ProPAP = Promise<PAP>;
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
export interface Actions{
|
|
36
|
+
write(self: AP & BEAllProps): ProPAP;
|
|
37
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { JSONObject } from '../trans-render/lib/types';
|
|
2
|
+
import { Specifier } from '../trans-render/dss/types';
|
|
3
|
+
import { URLBuilder } from '../../URLBuilder';
|
|
4
|
+
//import {SimpleWCInfo} from 'may-it-be/SimpleWCInfo';
|
|
5
|
+
|
|
6
|
+
declare class WeakRef<TProps = any>{}
|
|
7
|
+
/**
|
|
8
|
+
* fetch-for props
|
|
9
|
+
*/
|
|
10
|
+
export interface EndUserProps{
|
|
11
|
+
|
|
12
|
+
accept?: string,
|
|
13
|
+
/**
|
|
14
|
+
* Url to invoke
|
|
15
|
+
* @readonly true
|
|
16
|
+
*/
|
|
17
|
+
src?: string,
|
|
18
|
+
|
|
19
|
+
':src': string,
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Specifier for list of form associated or contentEditable peer elements that
|
|
23
|
+
* should partake in forming the URL.
|
|
24
|
+
*/
|
|
25
|
+
for?: string,
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Indicates whether to treat the response as HTML or JSON or Text
|
|
29
|
+
*/
|
|
30
|
+
as?: 'html' | 'json' | 'text',
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The http verb to be used for the request
|
|
34
|
+
*/
|
|
35
|
+
method?:
|
|
36
|
+
| 'GET'
|
|
37
|
+
| 'HEAD'
|
|
38
|
+
| 'POST'
|
|
39
|
+
| 'PUT'
|
|
40
|
+
| 'DELETE'
|
|
41
|
+
| 'OPTIONS'
|
|
42
|
+
| 'TRACE'
|
|
43
|
+
| 'PATCH',
|
|
44
|
+
/**
|
|
45
|
+
* Either the JSON stringified or the parsed JSON object
|
|
46
|
+
* If parsed, the web component will stringify it.
|
|
47
|
+
*/
|
|
48
|
+
body?: any,
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Request credentials
|
|
52
|
+
*/
|
|
53
|
+
credentials?: RequestCredentials,
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Directed Scoped Specifier to the
|
|
57
|
+
* DOM element where the retrieved content should be applied.
|
|
58
|
+
*/
|
|
59
|
+
target?: string,
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* If as=html, specify whether to (stream) the contents into an attached shadow DOM or not.
|
|
63
|
+
*/
|
|
64
|
+
shadow?: ShadowRootMode,
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Do not cache results even if the url has been invoked before.
|
|
68
|
+
*/
|
|
69
|
+
noCache?: boolean,
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Stream the contents into the target element
|
|
73
|
+
*/
|
|
74
|
+
stream?: boolean,
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Directed Scoped Specifier to a
|
|
78
|
+
* (button) element, to delay submitting the fetch request until that button is clicked.
|
|
79
|
+
*/
|
|
80
|
+
when?: string,
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Directed Scoped Specifier to a form element
|
|
84
|
+
* that we should use to form the url and body from.
|
|
85
|
+
*/
|
|
86
|
+
form?: string,
|
|
87
|
+
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface OverridableGetters{
|
|
91
|
+
//request$: RequestInit,
|
|
92
|
+
//accept$?: string,
|
|
93
|
+
value?: any,
|
|
94
|
+
//isAttrParsed?: boolean,
|
|
95
|
+
targetSelf?: boolean
|
|
96
|
+
targetSpecifier?: Specifier
|
|
97
|
+
whenCount?: number,
|
|
98
|
+
nextWhenCount?: number,
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export type EventName = string;
|
|
104
|
+
|
|
105
|
+
export interface AllProps extends EndUserProps, OverridableGetters{
|
|
106
|
+
|
|
107
|
+
readonly resolvedTarget?: Element | null,
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @readonly
|
|
111
|
+
* Weak references to input elements
|
|
112
|
+
*/
|
|
113
|
+
readonly forRefs: Map<string, [WeakRef<HTMLInputElement>, EventName]>,
|
|
114
|
+
readonly formData?: FormData,
|
|
115
|
+
readonly formRef?: WeakRef<HTMLFormElement>,
|
|
116
|
+
readonly formSpecifier?: Specifier,
|
|
117
|
+
readonly urlBuilder?: URLBuilder,
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export type PAP = Partial<AllProps>;
|
|
121
|
+
|
|
122
|
+
export type ProPP = Promise<PAP>;
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* methods for fetch-for
|
|
127
|
+
*/
|
|
128
|
+
export interface Methods extends Actions{
|
|
129
|
+
validateResp(resp: Response): boolean,
|
|
130
|
+
validateOn(): boolean,
|
|
131
|
+
setTargetProp(target: Element | null, data: any, shadow?: ShadowRootMode): void,
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface Actions{
|
|
135
|
+
do(self: this): Promise<void>;
|
|
136
|
+
bindSrc(self)
|
|
137
|
+
parseFor(self: this): ProPP;
|
|
138
|
+
parseTarget(self: this): ProPP;
|
|
139
|
+
// listenForInput(self: this): ProPP;
|
|
140
|
+
// doInitialLoad(self: this): ProPP;
|
|
141
|
+
initializeWhen(self: this): Promise<PP | undefined>;
|
|
142
|
+
// onForm(self: this): ProPP;
|
|
143
|
+
// onFormSpecifier(self: this): ProPP;
|
|
144
|
+
// onFormRef(self: this): Promise<void>,
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// https://github.com/webcomponents-cg/community-protocols/issues/12#issuecomment-872415080
|
|
148
|
+
export type loadEventName = 'load';
|
|
149
|
+
export type inputEventName = 'input';
|
|
150
|
+
export type selectionChangeEventName = 'select';
|
|
151
|
+
|
|
152
|
+
export interface EventForFetch {
|
|
153
|
+
href?: string;
|
|
154
|
+
trigger?: Element,
|
|
155
|
+
forData: ForData,
|
|
156
|
+
formData: FormData,
|
|
157
|
+
body?: string | JSONObject
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export type ForData = {[key: string]: HTMLInputElement}
|
|
161
|
+
|
|
162
|
+
// /**
|
|
163
|
+
// * fetch-for web component
|
|
164
|
+
// */
|
|
165
|
+
// export abstract class ForFetchInfo implements SimpleWCInfo {
|
|
166
|
+
// src: './for-fetch.js';
|
|
167
|
+
// tagName: 'for-fetch';
|
|
168
|
+
// props: EndUserProps;
|
|
169
|
+
// cssParts: {
|
|
170
|
+
|
|
171
|
+
// }
|
|
172
|
+
// }
|
|
173
|
+
|
|
174
|
+
// export type Package = [ForFetchInfo];
|
|
175
|
+
|
|
@@ -70,6 +70,11 @@ export interface AttribMatch{
|
|
|
70
70
|
// validator?: (v: any) => boolean;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
export interface WeakDual<T>{
|
|
74
|
+
weakSet: WeakSet<T>,
|
|
75
|
+
setWeak: Set<WeakRef<T>>
|
|
76
|
+
}
|
|
77
|
+
|
|
73
78
|
export interface IMountObserver {
|
|
74
79
|
// readonly mountInit: MountInit,
|
|
75
80
|
// readonly mountedRefs: WeakRef<Element>[],
|
|
@@ -77,7 +82,7 @@ export interface IMountObserver {
|
|
|
77
82
|
observe(within: Node): void;
|
|
78
83
|
disconnect(within: Node): void;
|
|
79
84
|
module?: any;
|
|
80
|
-
mountedElements:
|
|
85
|
+
mountedElements: WeakDual<Element>;
|
|
81
86
|
readAttrs(match: Element, branchIndexes?: Set<number>) : AttrChangeInfo[];
|
|
82
87
|
observedAttrs(): Promise<Array<string> | undefined>;
|
|
83
88
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { PropInfo } from "../froop/types";
|
|
2
|
+
|
|
3
|
+
export type storage = 'sessionStorage' | 'localStorage';
|
|
4
|
+
|
|
5
|
+
export type protocols =
|
|
6
|
+
| storage
|
|
7
|
+
| 'indexedDB'
|
|
8
|
+
| 'globalThis'
|
|
9
|
+
| 'cookie'
|
|
10
|
+
| 'locationHash'
|
|
11
|
+
;
|
|
12
|
+
|
|
13
|
+
export type db = string;
|
|
14
|
+
export type storeName = string;
|
|
15
|
+
export type key = string;
|
|
16
|
+
export type chainedAccessor = string;
|
|
17
|
+
|
|
18
|
+
export type idbUSP = `indexedDB://${db}/${storeName}/${key}`;
|
|
19
|
+
export type idbUSL = `${idbUSP}?.${chainedAccessor}`;
|
|
20
|
+
|
|
21
|
+
export type storageUSP = `${storage}://${key}`;
|
|
22
|
+
export type storageUSL = `${storageUSP}?.${chainedAccessor}`;
|
|
23
|
+
|
|
24
|
+
export type USP =
|
|
25
|
+
| idbUSP
|
|
26
|
+
| storageUSP
|
|
27
|
+
;
|
|
28
|
+
|
|
29
|
+
export type USL =
|
|
30
|
+
| idbUSP
|
|
31
|
+
| idbUSL
|
|
32
|
+
| storageUSP
|
|
33
|
+
| storageUSL
|
|
34
|
+
;
|
|
35
|
+
|
|
36
|
+
export interface ParsedUSL{
|
|
37
|
+
protocol: protocols,
|
|
38
|
+
accessorChain: string,
|
|
39
|
+
usp: USP,
|
|
40
|
+
uspParts: Array<string>
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface WrapperConfig<TProps = any> extends PropInfo {
|
|
44
|
+
USPProp: keyof TProps & string,
|
|
45
|
+
accessor: string,
|
|
46
|
+
cache: boolean,
|
|
47
|
+
maxStaleness: number,
|
|
48
|
+
//subscribe to window message
|
|
49
|
+
beVigilant: boolean,
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type USLMapping = {[key: string | number | symbol]: USL}
|
|
53
|
+
|
|
54
|
+
export interface StowArgs {
|
|
55
|
+
values: any,
|
|
56
|
+
mapping: USLMapping
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface SavingContext {
|
|
60
|
+
USLs: Set<USL>
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface CookieOptions {
|
|
64
|
+
secure: boolean | undefined,
|
|
65
|
+
'max-age': number | undefined,
|
|
66
|
+
expires: Date | string | undefined,
|
|
67
|
+
domain: string | undefined,
|
|
68
|
+
path: string | undefined,
|
|
69
|
+
}
|