bleam 0.0.5 → 0.0.7

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.
Files changed (141) hide show
  1. package/dist/ai.cjs +4146 -0
  2. package/dist/ai.d.cts +535 -0
  3. package/dist/ai.d.ts +535 -0
  4. package/dist/ai.js +4102 -0
  5. package/dist/animated.cjs +286 -0
  6. package/dist/animated.d.cts +47 -0
  7. package/dist/animated.d.ts +47 -0
  8. package/dist/animated.js +281 -0
  9. package/dist/app.cjs +92 -0
  10. package/dist/app.d.cts +1 -2
  11. package/dist/app.d.ts +1 -2
  12. package/dist/app.js +93 -2
  13. package/dist/bundler.d.cts +1 -2
  14. package/dist/bundler.d.ts +1 -2
  15. package/dist/cli.cjs +1375 -71
  16. package/dist/cli.d.cts +89 -1
  17. package/dist/cli.d.ts +89 -1
  18. package/dist/cli.js +1373 -74
  19. package/dist/config-Bb6SULnR.cjs +46 -0
  20. package/dist/config-CfWa3q-k.js +28 -0
  21. package/dist/config-Cms0rvqg.d.ts +40 -0
  22. package/dist/config-CufOVJV3.d.cts +40 -0
  23. package/dist/config.cjs +4 -25
  24. package/dist/config.d.cts +2 -28
  25. package/dist/config.d.ts +2 -28
  26. package/dist/config.js +2 -24
  27. package/dist/crypto-BB92-Upx.js +7 -0
  28. package/dist/crypto-CT3VZ7lF.cjs +13 -0
  29. package/dist/crypto.cjs +2 -2
  30. package/dist/crypto.d.cts +6 -1
  31. package/dist/crypto.d.ts +8 -1
  32. package/dist/crypto.js +2 -2
  33. package/dist/dev-protocol.d.cts +16 -3
  34. package/dist/dev-protocol.d.ts +16 -3
  35. package/dist/dev-protocol.js +1 -2
  36. package/dist/files-Bo7h9fik.cjs +468 -0
  37. package/dist/files-Ds1wT8C2.js +445 -0
  38. package/dist/files-DwA7pzr3.d.cts +99 -0
  39. package/dist/files-VrkQlKIT.d.ts +99 -0
  40. package/dist/files.cjs +7 -0
  41. package/dist/files.d.cts +2 -0
  42. package/dist/files.d.ts +2 -0
  43. package/dist/files.js +4 -0
  44. package/dist/index.cjs +4 -5
  45. package/dist/index.d.cts +2 -3
  46. package/dist/index.d.ts +2 -3
  47. package/dist/index.js +2 -4
  48. package/dist/native-runtime-C85Nuc4F.js +10 -0
  49. package/dist/{native-runtime-CdeT0JyQ.cjs → native-runtime-CsXnXkQn.cjs} +1 -14
  50. package/dist/native-sqlite-xcGdamRD.js +64 -0
  51. package/dist/native-sqlite-yQLD5s9i.cjs +66 -0
  52. package/dist/platform.cjs +27 -0
  53. package/dist/platform.d.cts +39 -0
  54. package/dist/platform.d.ts +39 -0
  55. package/dist/platform.js +21 -0
  56. package/dist/runtime.d.cts +1 -7
  57. package/dist/runtime.d.ts +1 -7
  58. package/dist/schema-Bo5Jvqus.js +90 -0
  59. package/dist/schema-DOOjfXvs.d.ts +58 -0
  60. package/dist/schema-ENSMX_1t.d.cts +58 -0
  61. package/dist/schema-rQ13mrpD.cjs +102 -0
  62. package/dist/schema.cjs +4 -0
  63. package/dist/schema.d.cts +2 -0
  64. package/dist/schema.d.ts +2 -0
  65. package/dist/schema.js +3 -0
  66. package/dist/state-Bx0VlTlO.cjs +852 -0
  67. package/dist/state-CAwe-Vw1.js +767 -0
  68. package/dist/state.cjs +19 -0
  69. package/dist/state.d.cts +159 -0
  70. package/dist/state.d.ts +159 -0
  71. package/dist/state.js +6 -0
  72. package/dist/styles.cjs +742 -0
  73. package/dist/styles.d.cts +701 -0
  74. package/dist/styles.d.ts +701 -0
  75. package/dist/styles.js +739 -0
  76. package/dist/ui-1WepaMS4.d.cts +92 -0
  77. package/dist/ui-234Plg7Z.d.cts +92 -0
  78. package/dist/ui-BJmXhz9Q.d.ts +92 -0
  79. package/dist/ui-Dd7SXdbg.d.cts +92 -0
  80. package/dist/ui-Ds88eETu.d.ts +92 -0
  81. package/dist/ui-TaqnB5SP.d.ts +92 -0
  82. package/dist/ui-WQvnXL0W.d.ts +92 -0
  83. package/dist/ui.cjs +364 -0
  84. package/dist/ui.d.cts +2 -0
  85. package/dist/ui.d.ts +2 -0
  86. package/dist/ui.js +357 -0
  87. package/dist/window.cjs +596 -0
  88. package/dist/window.d.cts +63 -0
  89. package/dist/window.d.ts +63 -0
  90. package/dist/window.js +589 -0
  91. package/metro-config.cjs +18 -13
  92. package/package.json +57 -21
  93. package/templates/basic/app/index.tsx +133 -12
  94. package/templates/basic/app.config.ts +4 -2
  95. package/templates/foundation-models/app/index.tsx +32 -0
  96. package/templates/foundation-models/app.config.ts +5 -0
  97. package/templates/image-generation/app/index.tsx +39 -0
  98. package/templates/image-generation/app.config.ts +5 -0
  99. package/templates/state/app/index.tsx +30 -0
  100. package/templates/state/app.config.ts +5 -0
  101. package/dist/app.d.cts.map +0 -1
  102. package/dist/app.d.ts.map +0 -1
  103. package/dist/app.js.map +0 -1
  104. package/dist/bundler.d.cts.map +0 -1
  105. package/dist/bundler.d.ts.map +0 -1
  106. package/dist/cli.js.map +0 -1
  107. package/dist/config.d.cts.map +0 -1
  108. package/dist/config.d.ts.map +0 -1
  109. package/dist/config.js.map +0 -1
  110. package/dist/crypto-BNhWeXMj.cjs +0 -15
  111. package/dist/crypto-Bg8cD8wX.d.cts +0 -8
  112. package/dist/crypto-Bg8cD8wX.d.cts.map +0 -1
  113. package/dist/crypto-CCA_hvao.js +0 -11
  114. package/dist/crypto-CCA_hvao.js.map +0 -1
  115. package/dist/crypto-IOzbNoJD.d.ts +0 -8
  116. package/dist/crypto-IOzbNoJD.d.ts.map +0 -1
  117. package/dist/dev-protocol.d.cts.map +0 -1
  118. package/dist/dev-protocol.d.ts.map +0 -1
  119. package/dist/dev-protocol.js.map +0 -1
  120. package/dist/fs-BK7joD1g.js +0 -13
  121. package/dist/fs-BK7joD1g.js.map +0 -1
  122. package/dist/fs-CEhcjuN6.d.ts +0 -9
  123. package/dist/fs-CEhcjuN6.d.ts.map +0 -1
  124. package/dist/fs-CfE8CHf_.d.cts +0 -9
  125. package/dist/fs-CfE8CHf_.d.cts.map +0 -1
  126. package/dist/fs-DKHYTPua.cjs +0 -18
  127. package/dist/fs.cjs +0 -3
  128. package/dist/fs.d.cts +0 -2
  129. package/dist/fs.d.ts +0 -2
  130. package/dist/fs.js +0 -3
  131. package/dist/native-runtime-BoqybBBf.js +0 -18
  132. package/dist/native-runtime-BoqybBBf.js.map +0 -1
  133. package/dist/native.cjs +0 -132
  134. package/dist/native.d.cts +0 -64
  135. package/dist/native.d.cts.map +0 -1
  136. package/dist/native.d.ts +0 -64
  137. package/dist/native.d.ts.map +0 -1
  138. package/dist/native.js +0 -133
  139. package/dist/native.js.map +0 -1
  140. package/dist/runtime.d.cts.map +0 -1
  141. package/dist/runtime.d.ts.map +0 -1
package/dist/state.cjs ADDED
@@ -0,0 +1,19 @@
1
+ require('./native-runtime-CsXnXkQn.cjs');
2
+ require('./crypto-CT3VZ7lF.cjs');
3
+ const require_state = require('./state-Bx0VlTlO.cjs');
4
+ require('./schema-rQ13mrpD.cjs');
5
+
6
+ exports.Collection = require_state.Collection;
7
+ exports.LiveStore = require_state.LiveStore;
8
+ exports.atom = require_state.atom;
9
+ exports.collection = require_state.collection;
10
+ exports.isLinked = require_state.isLinked;
11
+ exports.link = require_state.link;
12
+ exports.setting = require_state.setting;
13
+ exports.unlink = require_state.unlink;
14
+ exports.useAtom = require_state.useAtom;
15
+ exports.useField = require_state.useField;
16
+ exports.useList = require_state.useList;
17
+ exports.useSetting = require_state.useSetting;
18
+ exports.useStore = require_state.useStore;
19
+ exports.useView = require_state.useView;
@@ -0,0 +1,159 @@
1
+ import { a as FieldValue, f as SchemaOutput, l as SchemaInput, m as SchemaShape, t as BleamSchema } from "./schema-ENSMX_1t.cjs";
2
+
3
+ //#region src/state/atom.d.ts
4
+ type Listener = () => void;
5
+ interface Store<Value> {
6
+ get(): Value;
7
+ subscribe(listener: Listener): () => void;
8
+ }
9
+ interface WritableStore<Value> extends Store<Value> {
10
+ set(value: Value): void;
11
+ update(updater: (value: Value) => Value): void;
12
+ }
13
+ declare class LiveStore<Value> implements WritableStore<Value> {
14
+ private value;
15
+ private listeners;
16
+ constructor(value: Value);
17
+ get(): Value;
18
+ set(value: Value): void;
19
+ update(updater: (value: Value) => Value): void;
20
+ subscribe(listener: Listener): () => void;
21
+ }
22
+ type Atom<Value> = WritableStore<Value>;
23
+ type SetStoreValue<Value> = (value: Value | ((current: Value) => Value)) => void;
24
+ declare function atom<Value>(initialValue: Value): Atom<Value>;
25
+ declare function useStore<Value>(store: Store<Value>): Value;
26
+ declare function useAtom<Value>(value: Atom<Value>): readonly [Value, SetStoreValue<Value>];
27
+ //#endregion
28
+ //#region src/state/collection.d.ts
29
+ type FieldRecord = Record<string, FieldValue | undefined>;
30
+ type CollectionFields<Shape extends SchemaShape> = SchemaOutput<Shape>;
31
+ type CollectionInput<Shape extends SchemaShape> = SchemaInput<Shape>;
32
+ type CollectionData<Shape extends SchemaShape> = CollectionFields<Shape>;
33
+ type CollectionFieldKey<Shape extends SchemaShape> = Extract<keyof Shape, string>;
34
+ type CollectionFieldValue<Shape extends SchemaShape, Key extends CollectionFieldKey<Shape>> = Key extends keyof CollectionData<Shape> ? CollectionData<Shape>[Key] : undefined;
35
+ type Entry<Value> = {
36
+ value: Value | undefined;
37
+ error: unknown;
38
+ promise: Promise<unknown> | null;
39
+ version: number;
40
+ listeners: Set<Listener>;
41
+ };
42
+ type RawCollectionView = {
43
+ id: string;
44
+ collection: string;
45
+ createdAt: string;
46
+ updatedAt: string;
47
+ data: FieldRecord;
48
+ links: Record<string, string[]>;
49
+ };
50
+ type RecordEntry = Entry<RawCollectionView | null>;
51
+ type ListEntry = Entry<string[]> & {
52
+ dependencies: ListDependencies;
53
+ };
54
+ type CollectionReference = {
55
+ readonly name: string;
56
+ get(id: string): Promise<unknown>;
57
+ };
58
+ type ViewOptions = {
59
+ links?: CollectionReference[];
60
+ };
61
+ type ListWhereValue = FieldValue | ['equals' | 'greater-than' | 'less-than' | 'contains', FieldValue] | Array<['equals' | 'greater-than' | 'less-than' | 'contains', FieldValue]>;
62
+ type ListOptions<Shape extends SchemaShape> = {
63
+ where?: Partial<Record<CollectionFieldKey<Shape>, ListWhereValue>>;
64
+ sortBy?: CollectionFieldKey<Shape> | 'createdAt' | 'updatedAt';
65
+ order?: 'asc' | 'desc';
66
+ take?: number;
67
+ };
68
+ type NormalizedListOptions = {
69
+ where?: Record<string, Array<[string, FieldValue]>>;
70
+ sortBy?: string;
71
+ order?: 'asc' | 'desc';
72
+ take?: number;
73
+ };
74
+ type RecordChange = {
75
+ collection: string;
76
+ id: string;
77
+ previous: RawCollectionView | null;
78
+ next: RawCollectionView | null;
79
+ changedPaths: Set<string>;
80
+ };
81
+ type EdgeChange = {
82
+ type: 'link' | 'unlink';
83
+ left: {
84
+ collection: string;
85
+ id: string;
86
+ };
87
+ right: {
88
+ collection: string;
89
+ id: string;
90
+ };
91
+ };
92
+ type ListDependencies = {
93
+ collection: string;
94
+ paths: Set<string>;
95
+ options: NormalizedListOptions;
96
+ };
97
+ type CollectionView<Shape extends SchemaShape> = {
98
+ readonly id: string;
99
+ readonly collection: string;
100
+ readonly createdAt: string;
101
+ readonly updatedAt: string;
102
+ readonly data: CollectionData<Shape>;
103
+ readonly links: Record<string, string[]>;
104
+ };
105
+ declare class Collection<Shape extends SchemaShape> {
106
+ readonly name: string;
107
+ readonly shape: Shape;
108
+ readonly validator: BleamSchema<SchemaInput<Shape>, SchemaOutput<Shape>>;
109
+ private records;
110
+ private lists;
111
+ private fields;
112
+ constructor(name: string, shape: Shape);
113
+ validateListOptions(options?: ListOptions<Shape>): void;
114
+ getRecordEntry(id: string): RecordEntry;
115
+ getListEntry(options?: ListOptions<Shape>): ListEntry;
116
+ private getFieldEntry;
117
+ private notifyFields;
118
+ private setRecordValue;
119
+ private rawRecord;
120
+ private loadRecord;
121
+ private loadListRows;
122
+ private selectListRows;
123
+ private applyListOptions;
124
+ private refreshListEntry;
125
+ invalidateChanges(recordChanges: RecordChange[], edgeChanges?: EdgeChange[]): Promise<void>;
126
+ private refreshLoadedLinks;
127
+ private peekRecord;
128
+ insert(value: CollectionInput<Shape>): Promise<string>;
129
+ update(id: string, value: Partial<CollectionInput<Shape>>): Promise<void>;
130
+ delete(id: string): Promise<void>;
131
+ all(): Promise<CollectionView<Shape>[]>;
132
+ get(id: string): Promise<CollectionView<Shape> | null>;
133
+ subscribeRecord(id: string, listener: Listener): () => void;
134
+ subscribeList(options: ListOptions<Shape> | undefined, listener: Listener): () => void;
135
+ subscribeField(id: string, path: string, listener: Listener): () => void;
136
+ getRecordVersion(id: string): number;
137
+ getListVersion(options?: ListOptions<Shape>): number;
138
+ getFieldVersion(id: string, path: string): number;
139
+ getRecordSnapshot(id: string, options?: ViewOptions): CollectionView<Shape> | null | undefined;
140
+ getListSnapshot(options?: ListOptions<Shape>): string[] | undefined;
141
+ ensureRecord(id: string, options?: ViewOptions): Promise<RawCollectionView | null>;
142
+ ensureList(options?: ListOptions<Shape>): Promise<string[]>;
143
+ private deleteLinksForRecord;
144
+ }
145
+ declare function collection<Shape extends SchemaShape>(name: string, shape: Shape): Collection<Shape>;
146
+ declare function link<FirstShape extends SchemaShape, SecondShape extends SchemaShape>(firstCollection: Collection<FirstShape>, firstId: string, secondCollection: Collection<SecondShape>, secondId: string): Promise<void>;
147
+ declare function unlink<FirstShape extends SchemaShape, SecondShape extends SchemaShape>(firstCollection: Collection<FirstShape>, firstId: string, secondCollection: Collection<SecondShape>, secondId: string): Promise<void>;
148
+ declare function isLinked<FirstShape extends SchemaShape, SecondShape extends SchemaShape>(firstCollection: Collection<FirstShape>, firstId: string, secondCollection: Collection<SecondShape>, secondId: string): Promise<boolean>;
149
+ declare function useList<Shape extends SchemaShape>(collection: Collection<Shape>, options?: ListOptions<Shape>): string[];
150
+ declare function useView<Shape extends SchemaShape>(collection: Collection<Shape>, id: string, options?: ViewOptions): CollectionView<Shape> | null | undefined;
151
+ declare function useField<Shape extends SchemaShape, Key extends CollectionFieldKey<Shape>>(collection: Collection<Shape>, id: string, key: Key): CollectionFieldValue<Shape, Key> | undefined;
152
+ //#endregion
153
+ //#region src/state/setting.d.ts
154
+ type Setting<Value> = WritableStore<Value>;
155
+ type SetSettingValue<Value> = SetStoreValue<Value>;
156
+ declare function setting<Value extends string | number | boolean>(key: string, initialValue: Value): Setting<Value>;
157
+ declare function useSetting<Value>(value: Setting<Value>): readonly [Value, SetStoreValue<Value>];
158
+ //#endregion
159
+ export { Atom, Collection, CollectionView, ListOptions, Listener, LiveStore, SetSettingValue, SetStoreValue, Setting, Store, WritableStore, atom, collection, isLinked, link, setting, unlink, useAtom, useField, useList, useSetting, useStore, useView };
@@ -0,0 +1,159 @@
1
+ import { a as FieldValue, f as SchemaOutput, l as SchemaInput, m as SchemaShape, t as BleamSchema } from "./schema-DOOjfXvs.js";
2
+
3
+ //#region src/state/atom.d.ts
4
+ type Listener = () => void;
5
+ interface Store<Value> {
6
+ get(): Value;
7
+ subscribe(listener: Listener): () => void;
8
+ }
9
+ interface WritableStore<Value> extends Store<Value> {
10
+ set(value: Value): void;
11
+ update(updater: (value: Value) => Value): void;
12
+ }
13
+ declare class LiveStore<Value> implements WritableStore<Value> {
14
+ private value;
15
+ private listeners;
16
+ constructor(value: Value);
17
+ get(): Value;
18
+ set(value: Value): void;
19
+ update(updater: (value: Value) => Value): void;
20
+ subscribe(listener: Listener): () => void;
21
+ }
22
+ type Atom<Value> = WritableStore<Value>;
23
+ type SetStoreValue<Value> = (value: Value | ((current: Value) => Value)) => void;
24
+ declare function atom<Value>(initialValue: Value): Atom<Value>;
25
+ declare function useStore<Value>(store: Store<Value>): Value;
26
+ declare function useAtom<Value>(value: Atom<Value>): readonly [Value, SetStoreValue<Value>];
27
+ //#endregion
28
+ //#region src/state/collection.d.ts
29
+ type FieldRecord = Record<string, FieldValue | undefined>;
30
+ type CollectionFields<Shape extends SchemaShape> = SchemaOutput<Shape>;
31
+ type CollectionInput<Shape extends SchemaShape> = SchemaInput<Shape>;
32
+ type CollectionData<Shape extends SchemaShape> = CollectionFields<Shape>;
33
+ type CollectionFieldKey<Shape extends SchemaShape> = Extract<keyof Shape, string>;
34
+ type CollectionFieldValue<Shape extends SchemaShape, Key extends CollectionFieldKey<Shape>> = Key extends keyof CollectionData<Shape> ? CollectionData<Shape>[Key] : undefined;
35
+ type Entry<Value> = {
36
+ value: Value | undefined;
37
+ error: unknown;
38
+ promise: Promise<unknown> | null;
39
+ version: number;
40
+ listeners: Set<Listener>;
41
+ };
42
+ type RawCollectionView = {
43
+ id: string;
44
+ collection: string;
45
+ createdAt: string;
46
+ updatedAt: string;
47
+ data: FieldRecord;
48
+ links: Record<string, string[]>;
49
+ };
50
+ type RecordEntry = Entry<RawCollectionView | null>;
51
+ type ListEntry = Entry<string[]> & {
52
+ dependencies: ListDependencies;
53
+ };
54
+ type CollectionReference = {
55
+ readonly name: string;
56
+ get(id: string): Promise<unknown>;
57
+ };
58
+ type ViewOptions = {
59
+ links?: CollectionReference[];
60
+ };
61
+ type ListWhereValue = FieldValue | ['equals' | 'greater-than' | 'less-than' | 'contains', FieldValue] | Array<['equals' | 'greater-than' | 'less-than' | 'contains', FieldValue]>;
62
+ type ListOptions<Shape extends SchemaShape> = {
63
+ where?: Partial<Record<CollectionFieldKey<Shape>, ListWhereValue>>;
64
+ sortBy?: CollectionFieldKey<Shape> | 'createdAt' | 'updatedAt';
65
+ order?: 'asc' | 'desc';
66
+ take?: number;
67
+ };
68
+ type NormalizedListOptions = {
69
+ where?: Record<string, Array<[string, FieldValue]>>;
70
+ sortBy?: string;
71
+ order?: 'asc' | 'desc';
72
+ take?: number;
73
+ };
74
+ type RecordChange = {
75
+ collection: string;
76
+ id: string;
77
+ previous: RawCollectionView | null;
78
+ next: RawCollectionView | null;
79
+ changedPaths: Set<string>;
80
+ };
81
+ type EdgeChange = {
82
+ type: 'link' | 'unlink';
83
+ left: {
84
+ collection: string;
85
+ id: string;
86
+ };
87
+ right: {
88
+ collection: string;
89
+ id: string;
90
+ };
91
+ };
92
+ type ListDependencies = {
93
+ collection: string;
94
+ paths: Set<string>;
95
+ options: NormalizedListOptions;
96
+ };
97
+ type CollectionView<Shape extends SchemaShape> = {
98
+ readonly id: string;
99
+ readonly collection: string;
100
+ readonly createdAt: string;
101
+ readonly updatedAt: string;
102
+ readonly data: CollectionData<Shape>;
103
+ readonly links: Record<string, string[]>;
104
+ };
105
+ declare class Collection<Shape extends SchemaShape> {
106
+ readonly name: string;
107
+ readonly shape: Shape;
108
+ readonly validator: BleamSchema<SchemaInput<Shape>, SchemaOutput<Shape>>;
109
+ private records;
110
+ private lists;
111
+ private fields;
112
+ constructor(name: string, shape: Shape);
113
+ validateListOptions(options?: ListOptions<Shape>): void;
114
+ getRecordEntry(id: string): RecordEntry;
115
+ getListEntry(options?: ListOptions<Shape>): ListEntry;
116
+ private getFieldEntry;
117
+ private notifyFields;
118
+ private setRecordValue;
119
+ private rawRecord;
120
+ private loadRecord;
121
+ private loadListRows;
122
+ private selectListRows;
123
+ private applyListOptions;
124
+ private refreshListEntry;
125
+ invalidateChanges(recordChanges: RecordChange[], edgeChanges?: EdgeChange[]): Promise<void>;
126
+ private refreshLoadedLinks;
127
+ private peekRecord;
128
+ insert(value: CollectionInput<Shape>): Promise<string>;
129
+ update(id: string, value: Partial<CollectionInput<Shape>>): Promise<void>;
130
+ delete(id: string): Promise<void>;
131
+ all(): Promise<CollectionView<Shape>[]>;
132
+ get(id: string): Promise<CollectionView<Shape> | null>;
133
+ subscribeRecord(id: string, listener: Listener): () => void;
134
+ subscribeList(options: ListOptions<Shape> | undefined, listener: Listener): () => void;
135
+ subscribeField(id: string, path: string, listener: Listener): () => void;
136
+ getRecordVersion(id: string): number;
137
+ getListVersion(options?: ListOptions<Shape>): number;
138
+ getFieldVersion(id: string, path: string): number;
139
+ getRecordSnapshot(id: string, options?: ViewOptions): CollectionView<Shape> | null | undefined;
140
+ getListSnapshot(options?: ListOptions<Shape>): string[] | undefined;
141
+ ensureRecord(id: string, options?: ViewOptions): Promise<RawCollectionView | null>;
142
+ ensureList(options?: ListOptions<Shape>): Promise<string[]>;
143
+ private deleteLinksForRecord;
144
+ }
145
+ declare function collection<Shape extends SchemaShape>(name: string, shape: Shape): Collection<Shape>;
146
+ declare function link<FirstShape extends SchemaShape, SecondShape extends SchemaShape>(firstCollection: Collection<FirstShape>, firstId: string, secondCollection: Collection<SecondShape>, secondId: string): Promise<void>;
147
+ declare function unlink<FirstShape extends SchemaShape, SecondShape extends SchemaShape>(firstCollection: Collection<FirstShape>, firstId: string, secondCollection: Collection<SecondShape>, secondId: string): Promise<void>;
148
+ declare function isLinked<FirstShape extends SchemaShape, SecondShape extends SchemaShape>(firstCollection: Collection<FirstShape>, firstId: string, secondCollection: Collection<SecondShape>, secondId: string): Promise<boolean>;
149
+ declare function useList<Shape extends SchemaShape>(collection: Collection<Shape>, options?: ListOptions<Shape>): string[];
150
+ declare function useView<Shape extends SchemaShape>(collection: Collection<Shape>, id: string, options?: ViewOptions): CollectionView<Shape> | null | undefined;
151
+ declare function useField<Shape extends SchemaShape, Key extends CollectionFieldKey<Shape>>(collection: Collection<Shape>, id: string, key: Key): CollectionFieldValue<Shape, Key> | undefined;
152
+ //#endregion
153
+ //#region src/state/setting.d.ts
154
+ type Setting<Value> = WritableStore<Value>;
155
+ type SetSettingValue<Value> = SetStoreValue<Value>;
156
+ declare function setting<Value extends string | number | boolean>(key: string, initialValue: Value): Setting<Value>;
157
+ declare function useSetting<Value>(value: Setting<Value>): readonly [Value, SetStoreValue<Value>];
158
+ //#endregion
159
+ export { Atom, Collection, CollectionView, ListOptions, Listener, LiveStore, SetSettingValue, SetStoreValue, Setting, Store, WritableStore, atom, collection, isLinked, link, setting, unlink, useAtom, useField, useList, useSetting, useStore, useView };
package/dist/state.js ADDED
@@ -0,0 +1,6 @@
1
+ import "./native-runtime-C85Nuc4F.js";
2
+ import "./crypto-BB92-Upx.js";
3
+ import { a as isLinked, c as useField, d as LiveStore, f as atom, i as collection, l as useList, m as useStore, n as useSetting, o as link, p as useAtom, r as Collection, s as unlink, t as setting, u as useView } from "./state-CAwe-Vw1.js";
4
+ import "./schema-Bo5Jvqus.js";
5
+
6
+ export { Collection, LiveStore, atom, collection, isLinked, link, setting, unlink, useAtom, useField, useList, useSetting, useStore, useView };