@backtickjs/core 0.1.9 → 0.1.10
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/cs.d.ts +0 -14
- package/dist/cs.js +1 -11
- package/dist/cs.js.map +1 -1
- package/package.json +1 -1
- package/src/cs.ts +1 -24
package/dist/cs.d.ts
CHANGED
|
@@ -4,15 +4,6 @@ import type { Spliceable, SplicesAs, Spliced } from "./Spliceable.js";
|
|
|
4
4
|
declare function lift<T>(_: T): Client<T>;
|
|
5
5
|
declare function splice<T extends [T] extends [SplicesAs<T>] ? unknown : Spliceable>(_: T): unknown extends Spliced<T> ? any : Spliced<T>;
|
|
6
6
|
declare function awaited<T>(_: T): Awaited<T>;
|
|
7
|
-
/**
|
|
8
|
-
* The globals a project declares — its libs, `@types`, a `declare global` —
|
|
9
|
-
* as an ordinary object type: reading one it doesn't declare is an error
|
|
10
|
-
* however strict the project is, where `typeof globalThis` itself lets it
|
|
11
|
-
* through as `any` without `noImplicitAny`.
|
|
12
|
-
*/
|
|
13
|
-
export type GlobalThis = {
|
|
14
|
-
[Key in keyof typeof globalThis]: (typeof globalThis)[Key];
|
|
15
|
-
};
|
|
16
7
|
/**
|
|
17
8
|
* Writes a client script: code in the host's files that runs on the client.
|
|
18
9
|
* The template is one expression, one block in braces, or one function; a
|
|
@@ -20,16 +11,11 @@ export type GlobalThis = {
|
|
|
20
11
|
* `${expression}` splice host values into it. Returns a `Client<T>`, `T`
|
|
21
12
|
* being what the script computes. Compiled when the host loads the file, by
|
|
22
13
|
* a Backtick plugin; called uncompiled, it throws.
|
|
23
|
-
*
|
|
24
|
-
* `cs.globalThis` is what a name the script didn't bind is read off. In the
|
|
25
|
-
* type and not in the object: nothing runs the virtual code it is written in.
|
|
26
14
|
*/
|
|
27
15
|
export declare const cs: ((_strings: TemplateStringsArray, ..._values: unknown[]) => Client<unknown>) & {
|
|
28
16
|
awaited: typeof awaited;
|
|
29
17
|
create: typeof create;
|
|
30
18
|
lift: typeof lift;
|
|
31
19
|
splice: typeof splice;
|
|
32
|
-
} & {
|
|
33
|
-
readonly globalThis: GlobalThis;
|
|
34
20
|
};
|
|
35
21
|
export {};
|
package/dist/cs.js
CHANGED
|
@@ -20,13 +20,6 @@ function awaited(_) {
|
|
|
20
20
|
throw new Error("Don't call `cs.awaited` directly; it's used to generate virtual " +
|
|
21
21
|
"code for the typechecker. Write code using cs`...` instead.");
|
|
22
22
|
}
|
|
23
|
-
// What hangs off the tag.
|
|
24
|
-
const members = {
|
|
25
|
-
awaited,
|
|
26
|
-
create,
|
|
27
|
-
lift,
|
|
28
|
-
splice,
|
|
29
|
-
};
|
|
30
23
|
/**
|
|
31
24
|
* Writes a client script: code in the host's files that runs on the client.
|
|
32
25
|
* The template is one expression, one block in braces, or one function; a
|
|
@@ -34,11 +27,8 @@ const members = {
|
|
|
34
27
|
* `${expression}` splice host values into it. Returns a `Client<T>`, `T`
|
|
35
28
|
* being what the script computes. Compiled when the host loads the file, by
|
|
36
29
|
* a Backtick plugin; called uncompiled, it throws.
|
|
37
|
-
*
|
|
38
|
-
* `cs.globalThis` is what a name the script didn't bind is read off. In the
|
|
39
|
-
* type and not in the object: nothing runs the virtual code it is written in.
|
|
40
30
|
*/
|
|
41
31
|
export const cs = Object.assign((_strings, ..._values) => {
|
|
42
32
|
throw new Error("`cs` was not compiled. Is @backtickjs set up for this project?");
|
|
43
|
-
},
|
|
33
|
+
}, { awaited, create, lift, splice });
|
|
44
34
|
//# sourceMappingURL=cs.js.map
|
package/dist/cs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cs.js","sourceRoot":"","sources":["../src/cs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,uBAAuB;AACvB,SAAS,IAAI,CAAI,CAAI;IACnB,MAAM,IAAI,KAAK,CACb,+DAA+D;QAC7D,6DAA6D,CAChE,CAAC;AACJ,CAAC;AAED,uEAAuE;AACvE,0EAA0E;AAC1E,yEAAyE;AACzE,gFAAgF;AAChF,sEAAsE;AACtE,uEAAuE;AACvE,SAAS,MAAM,CACb,CAAI;IAEJ,MAAM,IAAI,KAAK,CACb,iEAAiE;QAC/D,6DAA6D,CAChE,CAAC;AACJ,CAAC;AAED,6EAA6E;AAC7E,gDAAgD;AAChD,SAAS,OAAO,CAAI,CAAI;IACtB,MAAM,IAAI,KAAK,CACb,kEAAkE;QAChE,6DAA6D,CAChE,CAAC;AACJ,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"cs.js","sourceRoot":"","sources":["../src/cs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,uBAAuB;AACvB,SAAS,IAAI,CAAI,CAAI;IACnB,MAAM,IAAI,KAAK,CACb,+DAA+D;QAC7D,6DAA6D,CAChE,CAAC;AACJ,CAAC;AAED,uEAAuE;AACvE,0EAA0E;AAC1E,yEAAyE;AACzE,gFAAgF;AAChF,sEAAsE;AACtE,uEAAuE;AACvE,SAAS,MAAM,CACb,CAAI;IAEJ,MAAM,IAAI,KAAK,CACb,iEAAiE;QAC/D,6DAA6D,CAChE,CAAC;AACJ,CAAC;AAED,6EAA6E;AAC7E,gDAAgD;AAChD,SAAS,OAAO,CAAI,CAAI;IACtB,MAAM,IAAI,KAAK,CACb,kEAAkE;QAChE,6DAA6D,CAChE,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAC7B,CAAC,QAA8B,EAAE,GAAG,OAAkB,EAAmB,EAAE;IACzE,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAC;AACJ,CAAC,EACD,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAClC,CAAC"}
|
package/package.json
CHANGED
package/src/cs.ts
CHANGED
|
@@ -34,24 +34,6 @@ function awaited<T>(_: T): Awaited<T> {
|
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
// What hangs off the tag.
|
|
38
|
-
const members = {
|
|
39
|
-
awaited,
|
|
40
|
-
create,
|
|
41
|
-
lift,
|
|
42
|
-
splice,
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* The globals a project declares — its libs, `@types`, a `declare global` —
|
|
47
|
-
* as an ordinary object type: reading one it doesn't declare is an error
|
|
48
|
-
* however strict the project is, where `typeof globalThis` itself lets it
|
|
49
|
-
* through as `any` without `noImplicitAny`.
|
|
50
|
-
*/
|
|
51
|
-
export type GlobalThis = {
|
|
52
|
-
[Key in keyof typeof globalThis]: (typeof globalThis)[Key];
|
|
53
|
-
};
|
|
54
|
-
|
|
55
37
|
/**
|
|
56
38
|
* Writes a client script: code in the host's files that runs on the client.
|
|
57
39
|
* The template is one expression, one block in braces, or one function; a
|
|
@@ -59,9 +41,6 @@ export type GlobalThis = {
|
|
|
59
41
|
* `${expression}` splice host values into it. Returns a `Client<T>`, `T`
|
|
60
42
|
* being what the script computes. Compiled when the host loads the file, by
|
|
61
43
|
* a Backtick plugin; called uncompiled, it throws.
|
|
62
|
-
*
|
|
63
|
-
* `cs.globalThis` is what a name the script didn't bind is read off. In the
|
|
64
|
-
* type and not in the object: nothing runs the virtual code it is written in.
|
|
65
44
|
*/
|
|
66
45
|
export const cs = Object.assign(
|
|
67
46
|
(_strings: TemplateStringsArray, ..._values: unknown[]): Client<unknown> => {
|
|
@@ -69,7 +48,5 @@ export const cs = Object.assign(
|
|
|
69
48
|
"`cs` was not compiled. Is @backtickjs set up for this project?",
|
|
70
49
|
);
|
|
71
50
|
},
|
|
72
|
-
|
|
73
|
-
readonly globalThis: GlobalThis;
|
|
74
|
-
},
|
|
51
|
+
{ awaited, create, lift, splice },
|
|
75
52
|
);
|