@nil-/xit 0.0.3 → 0.0.4
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/index.d.ts +9 -4
- package/index.js +1 -7
- package/package.json +1 -5
package/index.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export type Action<T> = (target: T) => {
|
|
2
|
+
destroy: () => void;
|
|
3
|
+
};
|
|
4
|
+
export type Writable<T> = {
|
|
5
|
+
set: (v: T) => void;
|
|
6
|
+
subscribe: (cb: (v: T) => void) => () => void;
|
|
7
|
+
update: (cb: (v: T) => T) => void;
|
|
8
|
+
};
|
|
3
9
|
export type CoDec = {
|
|
4
10
|
encode: (o: object) => Uint8Array;
|
|
5
11
|
decode: (a: Uint8Array) => object;
|
|
@@ -17,5 +23,4 @@ export type Xit = {
|
|
|
17
23
|
};
|
|
18
24
|
loader: Loader;
|
|
19
25
|
};
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const json_string_codec: CoDec;
|
|
26
|
+
export declare const json_string: CoDec;
|
package/index.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import {} from "svelte/action";
|
|
3
|
-
import {} from "svelte/store";
|
|
4
|
-
export const nil_xit = () => {
|
|
5
|
-
return getContext("@nil-/xit");
|
|
6
|
-
};
|
|
7
|
-
export const json_string_codec = {
|
|
1
|
+
export const json_string = {
|
|
8
2
|
encode: (o) => new TextEncoder().encode(JSON.stringify(o)),
|
|
9
3
|
decode: (o) => JSON.parse(new TextDecoder().decode(o))
|
|
10
4
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nil-/xit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@rollup/browser": "^4.21.2",
|
|
6
6
|
"acorn": "^8.12.1",
|
|
@@ -15,10 +15,6 @@
|
|
|
15
15
|
".": {
|
|
16
16
|
"types": "./index.d.ts",
|
|
17
17
|
"default": "./index.js"
|
|
18
|
-
},
|
|
19
|
-
"./binding": {
|
|
20
|
-
"types": "./src/types.d.ts",
|
|
21
|
-
"default": "./src/binding.js"
|
|
22
18
|
}
|
|
23
19
|
}
|
|
24
20
|
}
|