@knapsack/types 4.69.10--canary.4778.7061c3b.0 → 4.69.10--canary.4745.042d9e2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +0 -18
- package/dist/index.js +77 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +73 -2
- package/dist/index.mjs.map +1 -1
- package/dist/renderer-client-types.d.ts +0 -9
- package/dist/renderer-client-types.d.ts.map +1 -1
- package/dist/renderers.d.ts +105 -0
- package/dist/renderers.d.ts.map +1 -1
- package/package.json +6 -6
@@ -19,15 +19,6 @@ export type KsRendererClientMsg = {
|
|
19
19
|
msg: string;
|
20
20
|
feedbackType?: FeedbackTypes;
|
21
21
|
};
|
22
|
-
/**
|
23
|
-
* The meta data is stored in a script tag with this id
|
24
|
-
* @see {KsRendererClientMeta}
|
25
|
-
*/
|
26
|
-
export declare const ksRendererClientMetaId = "ks-meta";
|
27
|
-
/**
|
28
|
-
* Metadata about the current renderer client demo
|
29
|
-
* @see {ksRendererClientMetaId} for the ID of the script tag
|
30
|
-
*/
|
31
22
|
export interface KsRendererClientMeta {
|
32
23
|
patternId: string;
|
33
24
|
templateId: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"renderer-client-types.d.ts","sourceRoot":"","sources":["../src/renderer-client-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,oBAAY,sBAAsB;IAChC,KAAK,UAAU;CAChB;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IACE;;OAEG;IACH,IAAI,EAAE,iCAAiC,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE,IAAI,EAAE,4BAA4B,CAAC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEN
|
1
|
+
{"version":3,"file":"renderer-client-types.d.ts","sourceRoot":"","sources":["../src/renderer-client-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,oBAAY,sBAAsB;IAChC,KAAK,UAAU;CAChB;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IACE;;OAEG;IACH,IAAI,EAAE,iCAAiC,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE,IAAI,EAAE,4BAA4B,CAAC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEN,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB"}
|
package/dist/renderers.d.ts
CHANGED
@@ -13,6 +13,110 @@ export declare const rendererIds: {
|
|
13
13
|
* @see {KnapsackPatternTemplate['templateLanguageId']}
|
14
14
|
*/
|
15
15
|
export type RendererId = keyof typeof rendererIds;
|
16
|
+
/**
|
17
|
+
* Information about JS imports that can describe how to import a module in these ways:
|
18
|
+
* - `import { Foo, Bar } from './foo';`
|
19
|
+
* - `import * as Foo from './foo';`
|
20
|
+
* - `import Foo from './foo';`
|
21
|
+
*
|
22
|
+
* Used in Webpack-based renderers
|
23
|
+
*/
|
24
|
+
export type KsJsImportInfo = {
|
25
|
+
type: 'default';
|
26
|
+
/** import name from 'path'; */
|
27
|
+
name: string;
|
28
|
+
path: string;
|
29
|
+
} | {
|
30
|
+
type: 'named';
|
31
|
+
path: string;
|
32
|
+
/** import { name } from 'path'; */
|
33
|
+
name: string;
|
34
|
+
} | {
|
35
|
+
type: 'all';
|
36
|
+
path: string;
|
37
|
+
/** import * as name from 'path'; */
|
38
|
+
name: string;
|
39
|
+
};
|
40
|
+
/** The result of `import`-ing a module */
|
41
|
+
type EsModuleObject<ExportedType = unknown> = {
|
42
|
+
default?: ExportedType;
|
43
|
+
[key: string]: ExportedType;
|
44
|
+
};
|
45
|
+
export type KsJsImport = {
|
46
|
+
type: 'pattern-template';
|
47
|
+
patternId: string;
|
48
|
+
templateId: string;
|
49
|
+
importInfo: KsJsImportInfo;
|
50
|
+
} | {
|
51
|
+
type: 'pattern-template-demo';
|
52
|
+
patternId: string;
|
53
|
+
templateId: string;
|
54
|
+
demoId: string;
|
55
|
+
importInfo: KsJsImportInfo;
|
56
|
+
} | {
|
57
|
+
type: 'extra';
|
58
|
+
importInfo: KsJsImportInfo;
|
59
|
+
};
|
60
|
+
type GetKsJsImportParam = {
|
61
|
+
type: 'pattern-template';
|
62
|
+
patternId: string;
|
63
|
+
templateId: string;
|
64
|
+
} | {
|
65
|
+
type: 'pattern-template-demo';
|
66
|
+
patternId: string;
|
67
|
+
templateId: string;
|
68
|
+
demoId: string;
|
69
|
+
} | {
|
70
|
+
type: 'extra';
|
71
|
+
name: string;
|
72
|
+
};
|
73
|
+
type GetKsJsImportPatternParam = {
|
74
|
+
patternId: string;
|
75
|
+
templateId: string;
|
76
|
+
demoId?: string;
|
77
|
+
};
|
78
|
+
/**
|
79
|
+
* This is `window.knapsack` inside the renderer client: the iframe container for renderer components
|
80
|
+
*/
|
81
|
+
export interface KsRendererClientGlobal<ExportedComponentType = unknown> {
|
82
|
+
typeName: 'KsRendererClientGlobal';
|
83
|
+
importedModules: {
|
84
|
+
[id: string]: () => Promise<EsModuleObject<ExportedComponentType>>;
|
85
|
+
};
|
86
|
+
allAvailableImports: KsJsImport[];
|
87
|
+
getImport: (opt: GetKsJsImportParam) => Promise<{
|
88
|
+
name: string;
|
89
|
+
/** Most likely a component */
|
90
|
+
value: ExportedComponentType;
|
91
|
+
}>;
|
92
|
+
getImports: (imports: GetKsJsImportParam[]) => Promise<{
|
93
|
+
[importName: string]: ExportedComponentType;
|
94
|
+
}>;
|
95
|
+
getPatternImport: (opt: GetKsJsImportPatternParam) => Promise<{
|
96
|
+
name: string;
|
97
|
+
/** Most likely a component */
|
98
|
+
value: ExportedComponentType;
|
99
|
+
}>;
|
100
|
+
getExtraImport: (opt: {
|
101
|
+
name: string;
|
102
|
+
}) => Promise<{
|
103
|
+
name: string;
|
104
|
+
/** Most likely a component */
|
105
|
+
value: ExportedComponentType;
|
106
|
+
}>;
|
107
|
+
getAllImports: (opt: {
|
108
|
+
patterns: GetKsJsImportPatternParam[];
|
109
|
+
extras?: {
|
110
|
+
name: string;
|
111
|
+
}[];
|
112
|
+
}) => Promise<{
|
113
|
+
[importName: string]: ExportedComponentType;
|
114
|
+
}>;
|
115
|
+
}
|
116
|
+
export declare function isKsJsImports(imports: unknown): imports is KsJsImport[];
|
117
|
+
export declare function isKsRendererClientGlobalImportedModules(mods: unknown): mods is KsRendererClientGlobal['importedModules'];
|
118
|
+
export declare function isKsRendererClientGlobal<ExportedComponentType = unknown>(knapsack: unknown): knapsack is KsRendererClientGlobal<ExportedComponentType>;
|
119
|
+
export declare function getKsRendererClientGlobal<ExportedComponentType = unknown>(): KsRendererClientGlobal<ExportedComponentType>;
|
16
120
|
/**
|
17
121
|
* Results of rendering a pattern
|
18
122
|
*/
|
@@ -46,4 +150,5 @@ export type TemplateSuggestionsGetFn = (opt: {
|
|
46
150
|
* ```
|
47
151
|
*/
|
48
152
|
export type PkgPathAliases = Record<string, string>;
|
153
|
+
export {};
|
49
154
|
//# sourceMappingURL=renderers.d.ts.map
|
package/dist/renderers.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"renderers.d.ts","sourceRoot":"","sources":["../src/renderers.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"renderers.d.ts","sourceRoot":"","sources":["../src/renderers.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;;;;;;;;CAQd,CAAC;AAEX;;;;GAIG;AACH,MAAM,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AE,MAAM,CAAC,CAAC"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@knapsack/types",
|
3
3
|
"description": "",
|
4
|
-
"version": "4.69.10--canary.
|
4
|
+
"version": "4.69.10--canary.4745.042d9e2.0",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"module": "dist/index.mjs",
|
7
7
|
"types": "dist/index.d.ts",
|
@@ -38,15 +38,15 @@
|
|
38
38
|
"test": "ava"
|
39
39
|
},
|
40
40
|
"dependencies": {
|
41
|
-
"@knapsack/utils": "4.69.10--canary.
|
41
|
+
"@knapsack/utils": "4.69.10--canary.4745.042d9e2.0",
|
42
42
|
"color-string": "^1.9.1",
|
43
43
|
"immer": "^10.0.4",
|
44
44
|
"superstruct": "^0.16.7"
|
45
45
|
},
|
46
46
|
"devDependencies": {
|
47
|
-
"@knapsack/eslint-config-starter": "4.69.10--canary.
|
48
|
-
"@knapsack/test-ava": "4.69.10--canary.
|
49
|
-
"@knapsack/typescript-config-starter": "4.69.10--canary.
|
47
|
+
"@knapsack/eslint-config-starter": "4.69.10--canary.4745.042d9e2.0",
|
48
|
+
"@knapsack/test-ava": "4.69.10--canary.4745.042d9e2.0",
|
49
|
+
"@knapsack/typescript-config-starter": "4.69.10--canary.4745.042d9e2.0",
|
50
50
|
"@tiptap/core": "^2.6.6",
|
51
51
|
"@types/color-string": "^1.5.5",
|
52
52
|
"@types/fs-extra": "^11.0.4",
|
@@ -68,5 +68,5 @@
|
|
68
68
|
"directory": "libs/types",
|
69
69
|
"type": "git"
|
70
70
|
},
|
71
|
-
"gitHead": "
|
71
|
+
"gitHead": "042d9e298dd2d00a1e60d83f1b0f0e64afebfa90"
|
72
72
|
}
|