bleam 0.0.5 → 0.0.6

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 (113) hide show
  1. package/dist/ai.cjs +187 -0
  2. package/dist/ai.d.cts +52 -0
  3. package/dist/ai.d.ts +52 -0
  4. package/dist/ai.js +182 -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.d.cts +1 -2
  10. package/dist/app.d.ts +1 -2
  11. package/dist/app.js +1 -2
  12. package/dist/bundler.d.cts +1 -2
  13. package/dist/bundler.d.ts +1 -2
  14. package/dist/chrome.cjs +265 -0
  15. package/dist/chrome.d.cts +19 -0
  16. package/dist/chrome.d.ts +19 -0
  17. package/dist/chrome.js +262 -0
  18. package/dist/cli.cjs +768 -31
  19. package/dist/cli.js +767 -34
  20. package/dist/config-Bb6SULnR.cjs +46 -0
  21. package/dist/config-CfWa3q-k.js +28 -0
  22. package/dist/config-ClDGHNb3.d.ts +39 -0
  23. package/dist/config-D3gPaVMb.d.cts +39 -0
  24. package/dist/config.cjs +4 -25
  25. package/dist/config.d.cts +2 -28
  26. package/dist/config.d.ts +2 -28
  27. package/dist/config.js +2 -24
  28. package/dist/crypto-BB92-Upx.js +7 -0
  29. package/dist/crypto-CT3VZ7lF.cjs +13 -0
  30. package/dist/crypto.cjs +2 -2
  31. package/dist/crypto.d.cts +8 -1
  32. package/dist/crypto.d.ts +8 -1
  33. package/dist/crypto.js +2 -2
  34. package/dist/dev-protocol.d.cts +3 -3
  35. package/dist/dev-protocol.d.ts +3 -3
  36. package/dist/dev-protocol.js +1 -2
  37. package/dist/fs.cjs +12 -2
  38. package/dist/fs.d.cts +7 -1
  39. package/dist/fs.d.ts +7 -1
  40. package/dist/fs.js +10 -1
  41. package/dist/index.cjs +4 -5
  42. package/dist/index.d.cts +2 -3
  43. package/dist/index.d.ts +2 -3
  44. package/dist/index.js +2 -4
  45. package/dist/native-macos-D6p2SmUj.js +20 -0
  46. package/dist/native-macos-DLwo_ii9.cjs +31 -0
  47. package/dist/native-runtime-C85Nuc4F.js +10 -0
  48. package/dist/native-runtime-CbPzrs8j.d.cts +33 -0
  49. package/dist/{native-runtime-CdeT0JyQ.cjs → native-runtime-CsXnXkQn.cjs} +1 -14
  50. package/dist/native-runtime-DxHSrsTX.d.ts +33 -0
  51. package/dist/native.cjs +35 -32
  52. package/dist/native.d.cts +4 -34
  53. package/dist/native.d.ts +3 -33
  54. package/dist/native.js +36 -34
  55. package/dist/runtime.d.cts +1 -2
  56. package/dist/runtime.d.ts +1 -2
  57. package/dist/schema-BOuUHcqo.d.cts +58 -0
  58. package/dist/schema-DVmoD9JL.js +90 -0
  59. package/dist/schema-bxeeCyLn.cjs +102 -0
  60. package/dist/schema-ipsECAso.d.ts +58 -0
  61. package/dist/schema.cjs +4 -0
  62. package/dist/schema.d.cts +2 -0
  63. package/dist/schema.d.ts +2 -0
  64. package/dist/schema.js +3 -0
  65. package/dist/state.cjs +765 -0
  66. package/dist/state.d.cts +129 -0
  67. package/dist/state.d.ts +129 -0
  68. package/dist/state.js +747 -0
  69. package/dist/styles.cjs +742 -0
  70. package/dist/styles.d.cts +701 -0
  71. package/dist/styles.d.ts +701 -0
  72. package/dist/styles.js +739 -0
  73. package/dist/ui.cjs +113 -0
  74. package/dist/ui.d.cts +30 -0
  75. package/dist/ui.d.ts +30 -0
  76. package/dist/ui.js +110 -0
  77. package/metro-config.cjs +18 -13
  78. package/package.json +47 -13
  79. package/templates/basic/app/index.tsx +130 -12
  80. package/templates/basic/app.config.ts +4 -2
  81. package/dist/app.d.cts.map +0 -1
  82. package/dist/app.d.ts.map +0 -1
  83. package/dist/app.js.map +0 -1
  84. package/dist/bundler.d.cts.map +0 -1
  85. package/dist/bundler.d.ts.map +0 -1
  86. package/dist/cli.js.map +0 -1
  87. package/dist/config.d.cts.map +0 -1
  88. package/dist/config.d.ts.map +0 -1
  89. package/dist/config.js.map +0 -1
  90. package/dist/crypto-BNhWeXMj.cjs +0 -15
  91. package/dist/crypto-Bg8cD8wX.d.cts +0 -8
  92. package/dist/crypto-Bg8cD8wX.d.cts.map +0 -1
  93. package/dist/crypto-CCA_hvao.js +0 -11
  94. package/dist/crypto-CCA_hvao.js.map +0 -1
  95. package/dist/crypto-IOzbNoJD.d.ts +0 -8
  96. package/dist/crypto-IOzbNoJD.d.ts.map +0 -1
  97. package/dist/dev-protocol.d.cts.map +0 -1
  98. package/dist/dev-protocol.d.ts.map +0 -1
  99. package/dist/dev-protocol.js.map +0 -1
  100. package/dist/fs-BK7joD1g.js +0 -13
  101. package/dist/fs-BK7joD1g.js.map +0 -1
  102. package/dist/fs-CEhcjuN6.d.ts +0 -9
  103. package/dist/fs-CEhcjuN6.d.ts.map +0 -1
  104. package/dist/fs-CfE8CHf_.d.cts +0 -9
  105. package/dist/fs-CfE8CHf_.d.cts.map +0 -1
  106. package/dist/fs-DKHYTPua.cjs +0 -18
  107. package/dist/native-runtime-BoqybBBf.js +0 -18
  108. package/dist/native-runtime-BoqybBBf.js.map +0 -1
  109. package/dist/native.d.cts.map +0 -1
  110. package/dist/native.d.ts.map +0 -1
  111. package/dist/native.js.map +0 -1
  112. package/dist/runtime.d.cts.map +0 -1
  113. package/dist/runtime.d.ts.map +0 -1
@@ -0,0 +1,129 @@
1
+ import { f as SchemaOutput, l as SchemaInput, m as SchemaShape, t as BleamSchema } from "./schema-BOuUHcqo.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
+ declare function atom<Value>(initialValue: Value): Atom<Value>;
24
+ declare function useStore<Value>(store: Store<Value>): Value;
25
+ declare function useAtom<Value>(value: Atom<Value>): Value;
26
+ //#endregion
27
+ //#region src/state/collection.d.ts
28
+ type CollectionFields<Shape extends SchemaShape> = SchemaOutput<Shape>;
29
+ type CollectionInput<Shape extends SchemaShape> = SchemaInput<Shape>;
30
+ type CollectionData<Shape extends SchemaShape> = CollectionFields<Shape> | undefined;
31
+ type CollectionRecord<Shape extends SchemaShape> = CollectionFields<Shape> & {
32
+ readonly id: string;
33
+ data(): CollectionData<Shape>;
34
+ delete(): Promise<void>;
35
+ readonly set: (patch: Partial<CollectionInput<Shape>>) => Promise<void>;
36
+ with(name: string): unknown | undefined;
37
+ with<OtherShape extends SchemaShape>(collection: Collection<OtherShape>): CollectionRecord<OtherShape>[];
38
+ };
39
+ type CollectionReference = {
40
+ readonly name: string;
41
+ get(id: string): Promise<unknown>;
42
+ refreshQueries(): Promise<void>;
43
+ pin(record: object | string, name: string, target: object | CollectionReference, targetId?: string): Promise<void>;
44
+ unpin(record: object | string, name: string): Promise<void>;
45
+ };
46
+ type AnyRecord = object;
47
+ type JoinFilter = {
48
+ kind: 'record';
49
+ record: AnyRecord;
50
+ } | {
51
+ kind: 'id';
52
+ collection: CollectionReference;
53
+ id: string;
54
+ };
55
+ type JoinInclude = {
56
+ collection: CollectionReference;
57
+ };
58
+ type PinInclude = {
59
+ name: string;
60
+ target: CollectionReference;
61
+ };
62
+ declare class Collection<Shape extends SchemaShape> {
63
+ readonly name: string;
64
+ readonly shape: Shape;
65
+ readonly validator: BleamSchema<SchemaInput<Shape>, SchemaOutput<Shape>>;
66
+ private queries;
67
+ private store;
68
+ constructor(name: string, shape: Shape);
69
+ private initialize;
70
+ private load;
71
+ private notifyRecordListeners;
72
+ private currentRecords;
73
+ refreshQueries(): Promise<void>;
74
+ insert(value: CollectionInput<Shape>): Promise<CollectionRecord<Shape>>;
75
+ update(record: CollectionFields<Shape> | string, value: Partial<CollectionInput<Shape>>): Promise<void>;
76
+ delete(record: CollectionFields<Shape> | string): Promise<void>;
77
+ all(): Promise<CollectionRecord<Shape>[]>;
78
+ get(id: string): Promise<CollectionRecord<Shape> | undefined>;
79
+ pin(record: CollectionFields<Shape> | string, name: string, target: object | CollectionReference, targetId?: string): Promise<void>;
80
+ unpin(record: CollectionFields<Shape> | string, name: string): Promise<void>;
81
+ subscribeRecord(record: CollectionFields<Shape>, listener: Listener): () => void;
82
+ queryStore(query?: {
83
+ joins: JoinFilter[];
84
+ joinIncludes: JoinInclude[];
85
+ pinIncludes: PinInclude[];
86
+ }): Store<CollectionRecord<Shape>[]>;
87
+ private executeQuery;
88
+ private deleteLinksForRecord;
89
+ private deletePinsForRecord;
90
+ }
91
+ declare function collection<Shape extends SchemaShape>(name: string, shape: Shape): Collection<Shape>;
92
+ declare function link(first: object, second: object): Promise<void>;
93
+ declare function link<FirstShape extends SchemaShape, SecondShape extends SchemaShape>(firstCollection: Collection<FirstShape>, firstId: string, secondCollection: Collection<SecondShape>, secondId: string): Promise<void>;
94
+ declare function unlink(first: object, second: object): Promise<void>;
95
+ declare function unlink<FirstShape extends SchemaShape, SecondShape extends SchemaShape>(firstCollection: Collection<FirstShape>, firstId: string, secondCollection: Collection<SecondShape>, secondId: string): Promise<void>;
96
+ declare function isLinked(first: object, second: object): Promise<boolean>;
97
+ declare function isLinked<FirstShape extends SchemaShape, SecondShape extends SchemaShape>(firstCollection: Collection<FirstShape>, firstId: string, secondCollection: Collection<SecondShape>, secondId: string): Promise<boolean>;
98
+ declare function pin(source: object, name: string, target: object): Promise<void>;
99
+ declare function pin<SourceShape extends SchemaShape, TargetShape extends SchemaShape>(sourceCollection: Collection<SourceShape>, sourceId: string, name: string, targetCollection: Collection<TargetShape>, targetId: string): Promise<void>;
100
+ declare function unpin(source: object, name: string): Promise<void>;
101
+ declare function unpin<SourceShape extends SchemaShape>(sourceCollection: Collection<SourceShape>, sourceId: string, name: string): Promise<void>;
102
+ declare function isPinned(source: object, name: string, target: object): Promise<boolean>;
103
+ declare function isPinned<SourceShape extends SchemaShape, TargetShape extends SchemaShape>(sourceCollection: Collection<SourceShape>, sourceId: string, name: string, targetCollection: Collection<TargetShape>, targetId: string): Promise<boolean>;
104
+ declare class CollectionQuery<Shape extends SchemaShape> implements Store<CollectionRecord<Shape>[]> {
105
+ private readonly collection;
106
+ private joins;
107
+ private joinIncludes;
108
+ private pinIncludes;
109
+ private cachedStore?;
110
+ constructor(collection: Collection<Shape>);
111
+ join(record: object): this;
112
+ join<OtherShape extends SchemaShape>(collection: Collection<OtherShape>): this;
113
+ join<OtherShape extends SchemaShape>(collection: Collection<OtherShape>, id: string): this;
114
+ with<OtherShape extends SchemaShape>(name: string, target: Collection<OtherShape>): this;
115
+ get(): CollectionRecord<Shape>[];
116
+ subscribe(listener: Listener): () => void;
117
+ store(): Store<CollectionRecord<Shape>[]>;
118
+ }
119
+ declare class QueryBuilder {
120
+ from<Shape extends SchemaShape>(collection: Collection<Shape>): CollectionQuery<Shape>;
121
+ }
122
+ declare function useQuery<Output>(query: (builder: QueryBuilder) => Store<Output>): Output;
123
+ //#endregion
124
+ //#region src/state/setting.d.ts
125
+ type Setting<Value> = WritableStore<Value>;
126
+ declare function setting<Value extends string | number | boolean>(key: string, initialValue: Value): Setting<Value>;
127
+ declare function useSetting<Value>(value: Setting<Value>): Value;
128
+ //#endregion
129
+ export { Atom, Collection, CollectionRecord, Listener, LiveStore, QueryBuilder, Setting, Store, WritableStore, atom, collection, isLinked, isPinned, link, pin, setting, unlink, unpin, useAtom, useQuery, useSetting, useStore };
@@ -0,0 +1,129 @@
1
+ import { f as SchemaOutput, l as SchemaInput, m as SchemaShape, t as BleamSchema } from "./schema-ipsECAso.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
+ declare function atom<Value>(initialValue: Value): Atom<Value>;
24
+ declare function useStore<Value>(store: Store<Value>): Value;
25
+ declare function useAtom<Value>(value: Atom<Value>): Value;
26
+ //#endregion
27
+ //#region src/state/collection.d.ts
28
+ type CollectionFields<Shape extends SchemaShape> = SchemaOutput<Shape>;
29
+ type CollectionInput<Shape extends SchemaShape> = SchemaInput<Shape>;
30
+ type CollectionData<Shape extends SchemaShape> = CollectionFields<Shape> | undefined;
31
+ type CollectionRecord<Shape extends SchemaShape> = CollectionFields<Shape> & {
32
+ readonly id: string;
33
+ data(): CollectionData<Shape>;
34
+ delete(): Promise<void>;
35
+ readonly set: (patch: Partial<CollectionInput<Shape>>) => Promise<void>;
36
+ with(name: string): unknown | undefined;
37
+ with<OtherShape extends SchemaShape>(collection: Collection<OtherShape>): CollectionRecord<OtherShape>[];
38
+ };
39
+ type CollectionReference = {
40
+ readonly name: string;
41
+ get(id: string): Promise<unknown>;
42
+ refreshQueries(): Promise<void>;
43
+ pin(record: object | string, name: string, target: object | CollectionReference, targetId?: string): Promise<void>;
44
+ unpin(record: object | string, name: string): Promise<void>;
45
+ };
46
+ type AnyRecord = object;
47
+ type JoinFilter = {
48
+ kind: 'record';
49
+ record: AnyRecord;
50
+ } | {
51
+ kind: 'id';
52
+ collection: CollectionReference;
53
+ id: string;
54
+ };
55
+ type JoinInclude = {
56
+ collection: CollectionReference;
57
+ };
58
+ type PinInclude = {
59
+ name: string;
60
+ target: CollectionReference;
61
+ };
62
+ declare class Collection<Shape extends SchemaShape> {
63
+ readonly name: string;
64
+ readonly shape: Shape;
65
+ readonly validator: BleamSchema<SchemaInput<Shape>, SchemaOutput<Shape>>;
66
+ private queries;
67
+ private store;
68
+ constructor(name: string, shape: Shape);
69
+ private initialize;
70
+ private load;
71
+ private notifyRecordListeners;
72
+ private currentRecords;
73
+ refreshQueries(): Promise<void>;
74
+ insert(value: CollectionInput<Shape>): Promise<CollectionRecord<Shape>>;
75
+ update(record: CollectionFields<Shape> | string, value: Partial<CollectionInput<Shape>>): Promise<void>;
76
+ delete(record: CollectionFields<Shape> | string): Promise<void>;
77
+ all(): Promise<CollectionRecord<Shape>[]>;
78
+ get(id: string): Promise<CollectionRecord<Shape> | undefined>;
79
+ pin(record: CollectionFields<Shape> | string, name: string, target: object | CollectionReference, targetId?: string): Promise<void>;
80
+ unpin(record: CollectionFields<Shape> | string, name: string): Promise<void>;
81
+ subscribeRecord(record: CollectionFields<Shape>, listener: Listener): () => void;
82
+ queryStore(query?: {
83
+ joins: JoinFilter[];
84
+ joinIncludes: JoinInclude[];
85
+ pinIncludes: PinInclude[];
86
+ }): Store<CollectionRecord<Shape>[]>;
87
+ private executeQuery;
88
+ private deleteLinksForRecord;
89
+ private deletePinsForRecord;
90
+ }
91
+ declare function collection<Shape extends SchemaShape>(name: string, shape: Shape): Collection<Shape>;
92
+ declare function link(first: object, second: object): Promise<void>;
93
+ declare function link<FirstShape extends SchemaShape, SecondShape extends SchemaShape>(firstCollection: Collection<FirstShape>, firstId: string, secondCollection: Collection<SecondShape>, secondId: string): Promise<void>;
94
+ declare function unlink(first: object, second: object): Promise<void>;
95
+ declare function unlink<FirstShape extends SchemaShape, SecondShape extends SchemaShape>(firstCollection: Collection<FirstShape>, firstId: string, secondCollection: Collection<SecondShape>, secondId: string): Promise<void>;
96
+ declare function isLinked(first: object, second: object): Promise<boolean>;
97
+ declare function isLinked<FirstShape extends SchemaShape, SecondShape extends SchemaShape>(firstCollection: Collection<FirstShape>, firstId: string, secondCollection: Collection<SecondShape>, secondId: string): Promise<boolean>;
98
+ declare function pin(source: object, name: string, target: object): Promise<void>;
99
+ declare function pin<SourceShape extends SchemaShape, TargetShape extends SchemaShape>(sourceCollection: Collection<SourceShape>, sourceId: string, name: string, targetCollection: Collection<TargetShape>, targetId: string): Promise<void>;
100
+ declare function unpin(source: object, name: string): Promise<void>;
101
+ declare function unpin<SourceShape extends SchemaShape>(sourceCollection: Collection<SourceShape>, sourceId: string, name: string): Promise<void>;
102
+ declare function isPinned(source: object, name: string, target: object): Promise<boolean>;
103
+ declare function isPinned<SourceShape extends SchemaShape, TargetShape extends SchemaShape>(sourceCollection: Collection<SourceShape>, sourceId: string, name: string, targetCollection: Collection<TargetShape>, targetId: string): Promise<boolean>;
104
+ declare class CollectionQuery<Shape extends SchemaShape> implements Store<CollectionRecord<Shape>[]> {
105
+ private readonly collection;
106
+ private joins;
107
+ private joinIncludes;
108
+ private pinIncludes;
109
+ private cachedStore?;
110
+ constructor(collection: Collection<Shape>);
111
+ join(record: object): this;
112
+ join<OtherShape extends SchemaShape>(collection: Collection<OtherShape>): this;
113
+ join<OtherShape extends SchemaShape>(collection: Collection<OtherShape>, id: string): this;
114
+ with<OtherShape extends SchemaShape>(name: string, target: Collection<OtherShape>): this;
115
+ get(): CollectionRecord<Shape>[];
116
+ subscribe(listener: Listener): () => void;
117
+ store(): Store<CollectionRecord<Shape>[]>;
118
+ }
119
+ declare class QueryBuilder {
120
+ from<Shape extends SchemaShape>(collection: Collection<Shape>): CollectionQuery<Shape>;
121
+ }
122
+ declare function useQuery<Output>(query: (builder: QueryBuilder) => Store<Output>): Output;
123
+ //#endregion
124
+ //#region src/state/setting.d.ts
125
+ type Setting<Value> = WritableStore<Value>;
126
+ declare function setting<Value extends string | number | boolean>(key: string, initialValue: Value): Setting<Value>;
127
+ declare function useSetting<Value>(value: Setting<Value>): Value;
128
+ //#endregion
129
+ export { Atom, Collection, CollectionRecord, Listener, LiveStore, QueryBuilder, Setting, Store, WritableStore, atom, collection, isLinked, isPinned, link, pin, setting, unlink, unpin, useAtom, useQuery, useSetting, useStore };