bleam 0.0.13 → 0.0.14
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/ai.cjs +1 -1
- package/dist/ai.d.ts +1 -1
- package/dist/ai.js +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/elements-DX_YUveu.d.ts +341 -0
- package/dist/elements-gEI8YGl1.d.cts +341 -0
- package/dist/elements.cjs +582 -54
- package/dist/elements.d.cts +2 -2
- package/dist/elements.d.ts +2 -2
- package/dist/elements.js +560 -55
- package/dist/files.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/schema.d.ts +1 -1
- package/dist/{state-BZYyrE2-.cjs → state-Bm9GiRnU.cjs} +58 -7
- package/dist/{state-DkaRFkZJ.js → state-D8Firo9w.js} +57 -7
- package/dist/state.cjs +1 -1
- package/dist/state.d.ts +1 -1
- package/dist/state.js +1 -1
- package/dist/window.d.cts +1 -1
- package/dist/window.d.ts +3 -3
- package/package.json +4 -6
- package/templates/basic/app/index.tsx +7 -129
- package/templates/foundation-models/app/index.tsx +100 -41
- package/templates/native/ios/Podfile.lock +6 -0
- package/templates/native/package.json +6 -1
- package/templates/native/yarn.lock +5392 -3749
- package/dist/elements-CFk0QHw0.d.cts +0 -127
- package/dist/elements-ClGQ41Sc.d.ts +0 -127
- package/dist/native-sqlite-Dw--FI9a.cjs +0 -66
- package/dist/native-sqlite-WzRNzCSh.js +0 -64
- /package/dist/{config-Cms0rvqg.d.ts → config-Chi-flpJ.d.ts} +0 -0
- /package/dist/{files-4ZEoAWiv.d.ts → files-VrkQlKIT.d.ts} +0 -0
- /package/dist/{schema-LxnzAfgw.d.ts → schema-DsXZBnvc.d.ts} +0 -0
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import * as react4 from "react";
|
|
2
|
-
import { ReactNode } from "react";
|
|
3
|
-
import { ColorValue, PressableProps, StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
4
|
-
import * as _nativescript_react_native26 from "@nativescript/react-native";
|
|
5
|
-
|
|
6
|
-
//#region src/elements/shared.d.ts
|
|
7
|
-
type NativeStyle = ViewStyle & TextStyle;
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region src/elements/blur-view.d.ts
|
|
10
|
-
type BlurIntensity = 'ultraThin' | 'thin' | 'regular' | 'thick' | 'chrome';
|
|
11
|
-
type BlurColorScheme = 'auto' | 'light' | 'dark';
|
|
12
|
-
type BlurViewProps = {
|
|
13
|
-
children?: ReactNode;
|
|
14
|
-
style?: StyleProp<NativeStyle>;
|
|
15
|
-
intensity?: BlurIntensity;
|
|
16
|
-
colorScheme?: BlurColorScheme;
|
|
17
|
-
};
|
|
18
|
-
declare const BlurView: _nativescript_react_native26.UIKitViewComponent<BlurViewProps, _nativescript_react_native26.UIKitContainerResult<UIVisualEffectView, UIView>>;
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/elements/glass-shared.d.ts
|
|
21
|
-
type GlassStyle = 'regular' | 'clear' | 'none';
|
|
22
|
-
type GlassEffectStyleConfig = {
|
|
23
|
-
style: GlassStyle;
|
|
24
|
-
animate?: boolean;
|
|
25
|
-
animationDuration?: number;
|
|
26
|
-
};
|
|
27
|
-
type GlassVisualStyle = {
|
|
28
|
-
cornerRadius?: number;
|
|
29
|
-
borderWidth?: number;
|
|
30
|
-
borderColor?: ColorValue;
|
|
31
|
-
};
|
|
32
|
-
type GlassViewProps = {
|
|
33
|
-
children?: ReactNode;
|
|
34
|
-
style?: StyleProp<NativeStyle>;
|
|
35
|
-
glassStyle?: GlassVisualStyle;
|
|
36
|
-
glassEffectStyle?: GlassStyle | GlassEffectStyleConfig;
|
|
37
|
-
tintColor?: string;
|
|
38
|
-
isInteractive?: boolean;
|
|
39
|
-
};
|
|
40
|
-
type GlassContainerProps = {
|
|
41
|
-
children?: ReactNode;
|
|
42
|
-
style?: StyleProp<NativeStyle>;
|
|
43
|
-
glassStyle?: GlassVisualStyle;
|
|
44
|
-
spacing?: number;
|
|
45
|
-
};
|
|
46
|
-
//#endregion
|
|
47
|
-
//#region src/elements/glass-view.d.ts
|
|
48
|
-
declare const GlassView: _nativescript_react_native26.UIKitViewComponent<GlassViewProps, _nativescript_react_native26.UIKitContainerResult<UIVisualEffectView, UIView>>;
|
|
49
|
-
//#endregion
|
|
50
|
-
//#region src/elements/button.d.ts
|
|
51
|
-
type ButtonVariant = 'primary' | 'secondary' | 'plain';
|
|
52
|
-
type ButtonSize = 'small' | 'regular' | 'large';
|
|
53
|
-
type ButtonBaseProps = Omit<PressableProps, 'children' | 'disabled'> & {
|
|
54
|
-
label?: string;
|
|
55
|
-
icon?: ReactNode;
|
|
56
|
-
loading?: boolean;
|
|
57
|
-
disabled?: boolean;
|
|
58
|
-
size?: ButtonSize;
|
|
59
|
-
activeOpacity?: number;
|
|
60
|
-
labelStyle?: StyleProp<TextStyle>;
|
|
61
|
-
};
|
|
62
|
-
type ButtonProps = ButtonBaseProps & {
|
|
63
|
-
variant?: ButtonVariant;
|
|
64
|
-
};
|
|
65
|
-
type GlassButtonProps = ButtonBaseProps & Pick<GlassViewProps, 'glassEffectStyle' | 'tintColor'> & {
|
|
66
|
-
glassStyle?: GlassVisualStyle;
|
|
67
|
-
};
|
|
68
|
-
declare function Button({
|
|
69
|
-
accessibilityRole,
|
|
70
|
-
accessibilityState,
|
|
71
|
-
activeOpacity,
|
|
72
|
-
disabled,
|
|
73
|
-
icon,
|
|
74
|
-
label,
|
|
75
|
-
labelStyle,
|
|
76
|
-
loading,
|
|
77
|
-
size,
|
|
78
|
-
style,
|
|
79
|
-
variant,
|
|
80
|
-
...props
|
|
81
|
-
}: ButtonProps): react4.JSX.Element;
|
|
82
|
-
declare function GlassButton({
|
|
83
|
-
accessibilityRole,
|
|
84
|
-
accessibilityState,
|
|
85
|
-
activeOpacity,
|
|
86
|
-
disabled,
|
|
87
|
-
glassEffectStyle,
|
|
88
|
-
glassStyle,
|
|
89
|
-
icon,
|
|
90
|
-
label,
|
|
91
|
-
labelStyle,
|
|
92
|
-
loading,
|
|
93
|
-
size,
|
|
94
|
-
style,
|
|
95
|
-
tintColor,
|
|
96
|
-
...props
|
|
97
|
-
}: GlassButtonProps): react4.JSX.Element;
|
|
98
|
-
//#endregion
|
|
99
|
-
//#region src/elements/glass-container.d.ts
|
|
100
|
-
declare const GlassContainer: _nativescript_react_native26.UIKitViewComponent<GlassContainerProps, _nativescript_react_native26.UIKitContainerResult<UIVisualEffectView, UIView>>;
|
|
101
|
-
//#endregion
|
|
102
|
-
//#region src/elements/label.d.ts
|
|
103
|
-
type LabelTone = 'primary' | 'secondary' | 'tertiary';
|
|
104
|
-
type LabelProps = {
|
|
105
|
-
children?: ReactNode;
|
|
106
|
-
text?: string;
|
|
107
|
-
tone?: LabelTone;
|
|
108
|
-
numberOfLines?: number;
|
|
109
|
-
style?: StyleProp<NativeStyle>;
|
|
110
|
-
};
|
|
111
|
-
declare const Label: _nativescript_react_native26.UIKitViewComponent<LabelProps, UILabel>;
|
|
112
|
-
//#endregion
|
|
113
|
-
//#region src/elements/symbol.d.ts
|
|
114
|
-
type SymbolName = string;
|
|
115
|
-
type SymbolWeight = 'ultraLight' | 'thin' | 'light' | 'regular' | 'medium' | 'semibold' | 'bold' | 'heavy' | 'black';
|
|
116
|
-
type SymbolScale = 'small' | 'medium' | 'large';
|
|
117
|
-
type SymbolProps = {
|
|
118
|
-
symbol: SymbolName;
|
|
119
|
-
size?: number;
|
|
120
|
-
weight?: SymbolWeight;
|
|
121
|
-
scale?: SymbolScale;
|
|
122
|
-
color?: ColorValue;
|
|
123
|
-
style?: StyleProp<NativeStyle>;
|
|
124
|
-
};
|
|
125
|
-
declare const SFSymbol: _nativescript_react_native26.UIKitViewComponent<SymbolProps, UIImageView>;
|
|
126
|
-
//#endregion
|
|
127
|
-
export { BlurIntensity as C, BlurColorScheme as S, BlurViewProps as T, GlassContainerProps as _, SymbolWeight as a, GlassViewProps as b, LabelTone as c, ButtonProps as d, ButtonSize as f, GlassView as g, GlassButtonProps as h, SymbolScale as i, GlassContainer as l, GlassButton as m, SymbolName as n, Label as o, ButtonVariant as p, SymbolProps as r, LabelProps as s, SFSymbol as t, Button as u, GlassEffectStyleConfig as v, BlurView as w, GlassVisualStyle as x, GlassStyle as y };
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import * as _nativescript_react_native25 from "@nativescript/react-native";
|
|
2
|
-
import * as react3 from "react";
|
|
3
|
-
import { ReactNode } from "react";
|
|
4
|
-
import { ColorValue, PressableProps, StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
5
|
-
|
|
6
|
-
//#region src/elements/shared.d.ts
|
|
7
|
-
type NativeStyle = ViewStyle & TextStyle;
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region src/elements/blur-view.d.ts
|
|
10
|
-
type BlurIntensity = 'ultraThin' | 'thin' | 'regular' | 'thick' | 'chrome';
|
|
11
|
-
type BlurColorScheme = 'auto' | 'light' | 'dark';
|
|
12
|
-
type BlurViewProps = {
|
|
13
|
-
children?: ReactNode;
|
|
14
|
-
style?: StyleProp<NativeStyle>;
|
|
15
|
-
intensity?: BlurIntensity;
|
|
16
|
-
colorScheme?: BlurColorScheme;
|
|
17
|
-
};
|
|
18
|
-
declare const BlurView: _nativescript_react_native25.UIKitViewComponent<BlurViewProps, _nativescript_react_native25.UIKitContainerResult<UIVisualEffectView, UIView>>;
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/elements/glass-shared.d.ts
|
|
21
|
-
type GlassStyle = 'regular' | 'clear' | 'none';
|
|
22
|
-
type GlassEffectStyleConfig = {
|
|
23
|
-
style: GlassStyle;
|
|
24
|
-
animate?: boolean;
|
|
25
|
-
animationDuration?: number;
|
|
26
|
-
};
|
|
27
|
-
type GlassVisualStyle = {
|
|
28
|
-
cornerRadius?: number;
|
|
29
|
-
borderWidth?: number;
|
|
30
|
-
borderColor?: ColorValue;
|
|
31
|
-
};
|
|
32
|
-
type GlassViewProps = {
|
|
33
|
-
children?: ReactNode;
|
|
34
|
-
style?: StyleProp<NativeStyle>;
|
|
35
|
-
glassStyle?: GlassVisualStyle;
|
|
36
|
-
glassEffectStyle?: GlassStyle | GlassEffectStyleConfig;
|
|
37
|
-
tintColor?: string;
|
|
38
|
-
isInteractive?: boolean;
|
|
39
|
-
};
|
|
40
|
-
type GlassContainerProps = {
|
|
41
|
-
children?: ReactNode;
|
|
42
|
-
style?: StyleProp<NativeStyle>;
|
|
43
|
-
glassStyle?: GlassVisualStyle;
|
|
44
|
-
spacing?: number;
|
|
45
|
-
};
|
|
46
|
-
//#endregion
|
|
47
|
-
//#region src/elements/glass-view.d.ts
|
|
48
|
-
declare const GlassView: _nativescript_react_native25.UIKitViewComponent<GlassViewProps, _nativescript_react_native25.UIKitContainerResult<UIVisualEffectView, UIView>>;
|
|
49
|
-
//#endregion
|
|
50
|
-
//#region src/elements/button.d.ts
|
|
51
|
-
type ButtonVariant = 'primary' | 'secondary' | 'plain';
|
|
52
|
-
type ButtonSize = 'small' | 'regular' | 'large';
|
|
53
|
-
type ButtonBaseProps = Omit<PressableProps, 'children' | 'disabled'> & {
|
|
54
|
-
label?: string;
|
|
55
|
-
icon?: ReactNode;
|
|
56
|
-
loading?: boolean;
|
|
57
|
-
disabled?: boolean;
|
|
58
|
-
size?: ButtonSize;
|
|
59
|
-
activeOpacity?: number;
|
|
60
|
-
labelStyle?: StyleProp<TextStyle>;
|
|
61
|
-
};
|
|
62
|
-
type ButtonProps = ButtonBaseProps & {
|
|
63
|
-
variant?: ButtonVariant;
|
|
64
|
-
};
|
|
65
|
-
type GlassButtonProps = ButtonBaseProps & Pick<GlassViewProps, 'glassEffectStyle' | 'tintColor'> & {
|
|
66
|
-
glassStyle?: GlassVisualStyle;
|
|
67
|
-
};
|
|
68
|
-
declare function Button({
|
|
69
|
-
accessibilityRole,
|
|
70
|
-
accessibilityState,
|
|
71
|
-
activeOpacity,
|
|
72
|
-
disabled,
|
|
73
|
-
icon,
|
|
74
|
-
label,
|
|
75
|
-
labelStyle,
|
|
76
|
-
loading,
|
|
77
|
-
size,
|
|
78
|
-
style,
|
|
79
|
-
variant,
|
|
80
|
-
...props
|
|
81
|
-
}: ButtonProps): react3.JSX.Element;
|
|
82
|
-
declare function GlassButton({
|
|
83
|
-
accessibilityRole,
|
|
84
|
-
accessibilityState,
|
|
85
|
-
activeOpacity,
|
|
86
|
-
disabled,
|
|
87
|
-
glassEffectStyle,
|
|
88
|
-
glassStyle,
|
|
89
|
-
icon,
|
|
90
|
-
label,
|
|
91
|
-
labelStyle,
|
|
92
|
-
loading,
|
|
93
|
-
size,
|
|
94
|
-
style,
|
|
95
|
-
tintColor,
|
|
96
|
-
...props
|
|
97
|
-
}: GlassButtonProps): react3.JSX.Element;
|
|
98
|
-
//#endregion
|
|
99
|
-
//#region src/elements/glass-container.d.ts
|
|
100
|
-
declare const GlassContainer: _nativescript_react_native25.UIKitViewComponent<GlassContainerProps, _nativescript_react_native25.UIKitContainerResult<UIVisualEffectView, UIView>>;
|
|
101
|
-
//#endregion
|
|
102
|
-
//#region src/elements/label.d.ts
|
|
103
|
-
type LabelTone = 'primary' | 'secondary' | 'tertiary';
|
|
104
|
-
type LabelProps = {
|
|
105
|
-
children?: ReactNode;
|
|
106
|
-
text?: string;
|
|
107
|
-
tone?: LabelTone;
|
|
108
|
-
numberOfLines?: number;
|
|
109
|
-
style?: StyleProp<NativeStyle>;
|
|
110
|
-
};
|
|
111
|
-
declare const Label: _nativescript_react_native25.UIKitViewComponent<LabelProps, UILabel>;
|
|
112
|
-
//#endregion
|
|
113
|
-
//#region src/elements/symbol.d.ts
|
|
114
|
-
type SymbolName = string;
|
|
115
|
-
type SymbolWeight = 'ultraLight' | 'thin' | 'light' | 'regular' | 'medium' | 'semibold' | 'bold' | 'heavy' | 'black';
|
|
116
|
-
type SymbolScale = 'small' | 'medium' | 'large';
|
|
117
|
-
type SymbolProps = {
|
|
118
|
-
symbol: SymbolName;
|
|
119
|
-
size?: number;
|
|
120
|
-
weight?: SymbolWeight;
|
|
121
|
-
scale?: SymbolScale;
|
|
122
|
-
color?: ColorValue;
|
|
123
|
-
style?: StyleProp<NativeStyle>;
|
|
124
|
-
};
|
|
125
|
-
declare const SFSymbol: _nativescript_react_native25.UIKitViewComponent<SymbolProps, UIImageView>;
|
|
126
|
-
//#endregion
|
|
127
|
-
export { BlurIntensity as C, BlurColorScheme as S, BlurViewProps as T, GlassContainerProps as _, SymbolWeight as a, GlassViewProps as b, LabelTone as c, ButtonProps as d, ButtonSize as f, GlassView as g, GlassButtonProps as h, SymbolScale as i, GlassContainer as l, GlassButton as m, SymbolName as n, Label as o, ButtonVariant as p, SymbolProps as r, LabelProps as s, SFSymbol as t, Button as u, GlassEffectStyleConfig as v, BlurView as w, GlassVisualStyle as x, GlassStyle as y };
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
require('./native-runtime-CsXnXkQn.cjs');
|
|
3
|
-
let __nativescript_community_sqlite = require("@nativescript-community/sqlite");
|
|
4
|
-
__nativescript_community_sqlite = require_chunk.__toESM(__nativescript_community_sqlite);
|
|
5
|
-
|
|
6
|
-
//#region src/native-sqlite.ts
|
|
7
|
-
const databases = /* @__PURE__ */ new Map();
|
|
8
|
-
function documentsDirectory() {
|
|
9
|
-
const path = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.Document, NSSearchPathDomainMask.UserDomain, true).objectAtIndex(0);
|
|
10
|
-
if (!path) throw new Error("Could not resolve documents directory");
|
|
11
|
-
return String(path);
|
|
12
|
-
}
|
|
13
|
-
function ensureDirectory(path) {
|
|
14
|
-
const fileManager = NSFileManager.defaultManager;
|
|
15
|
-
if (fileManager.fileExistsAtPath(path)) return;
|
|
16
|
-
fileManager.createDirectoryAtPathWithIntermediateDirectoriesAttributesError(path, true, null, null);
|
|
17
|
-
}
|
|
18
|
-
function databasePath(name) {
|
|
19
|
-
const directory = `${documentsDirectory()}/bleam`;
|
|
20
|
-
ensureDirectory(directory);
|
|
21
|
-
return `${directory}/${name}`;
|
|
22
|
-
}
|
|
23
|
-
function toPluginParameters(parameters) {
|
|
24
|
-
return parameters;
|
|
25
|
-
}
|
|
26
|
-
function toSQLiteValue(value) {
|
|
27
|
-
if (typeof value === "string" || typeof value === "number" || value === null) return value;
|
|
28
|
-
throw new Error("SQLite blobs are not supported by Bleam state yet");
|
|
29
|
-
}
|
|
30
|
-
function toSQLiteRow(row) {
|
|
31
|
-
const output = {};
|
|
32
|
-
for (const [key, value] of Object.entries(row)) output[key] = toSQLiteValue(value);
|
|
33
|
-
return output;
|
|
34
|
-
}
|
|
35
|
-
var NativeSQLiteDatabase = class {
|
|
36
|
-
constructor(database) {
|
|
37
|
-
this.database = database;
|
|
38
|
-
}
|
|
39
|
-
execute(query, parameters) {
|
|
40
|
-
return this.database.execute(query, toPluginParameters(parameters));
|
|
41
|
-
}
|
|
42
|
-
async select(query, parameters) {
|
|
43
|
-
return (await this.database.select(query, toPluginParameters(parameters))).map(toSQLiteRow);
|
|
44
|
-
}
|
|
45
|
-
async get(query, parameters) {
|
|
46
|
-
const row = await this.database.get(query, toPluginParameters(parameters));
|
|
47
|
-
return row ? toSQLiteRow(row) : void 0;
|
|
48
|
-
}
|
|
49
|
-
transaction(action) {
|
|
50
|
-
return this.database.transaction(action);
|
|
51
|
-
}
|
|
52
|
-
close() {
|
|
53
|
-
this.database.close();
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
function openNativeSQLiteDatabase(name = "bleam.sqlite3") {
|
|
57
|
-
const path = databasePath(name);
|
|
58
|
-
const existing = databases.get(path);
|
|
59
|
-
if (existing) return new NativeSQLiteDatabase(existing);
|
|
60
|
-
const database = (0, __nativescript_community_sqlite.openOrCreate)(path);
|
|
61
|
-
databases.set(path, database);
|
|
62
|
-
return new NativeSQLiteDatabase(database);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
//#endregion
|
|
66
|
-
exports.openNativeSQLiteDatabase = openNativeSQLiteDatabase;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import "./native-runtime-C85Nuc4F.js";
|
|
2
|
-
import { openOrCreate } from "@nativescript-community/sqlite";
|
|
3
|
-
|
|
4
|
-
//#region src/native-sqlite.ts
|
|
5
|
-
const databases = /* @__PURE__ */ new Map();
|
|
6
|
-
function documentsDirectory() {
|
|
7
|
-
const path = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.Document, NSSearchPathDomainMask.UserDomain, true).objectAtIndex(0);
|
|
8
|
-
if (!path) throw new Error("Could not resolve documents directory");
|
|
9
|
-
return String(path);
|
|
10
|
-
}
|
|
11
|
-
function ensureDirectory(path) {
|
|
12
|
-
const fileManager = NSFileManager.defaultManager;
|
|
13
|
-
if (fileManager.fileExistsAtPath(path)) return;
|
|
14
|
-
fileManager.createDirectoryAtPathWithIntermediateDirectoriesAttributesError(path, true, null, null);
|
|
15
|
-
}
|
|
16
|
-
function databasePath(name) {
|
|
17
|
-
const directory = `${documentsDirectory()}/bleam`;
|
|
18
|
-
ensureDirectory(directory);
|
|
19
|
-
return `${directory}/${name}`;
|
|
20
|
-
}
|
|
21
|
-
function toPluginParameters(parameters) {
|
|
22
|
-
return parameters;
|
|
23
|
-
}
|
|
24
|
-
function toSQLiteValue(value) {
|
|
25
|
-
if (typeof value === "string" || typeof value === "number" || value === null) return value;
|
|
26
|
-
throw new Error("SQLite blobs are not supported by Bleam state yet");
|
|
27
|
-
}
|
|
28
|
-
function toSQLiteRow(row) {
|
|
29
|
-
const output = {};
|
|
30
|
-
for (const [key, value] of Object.entries(row)) output[key] = toSQLiteValue(value);
|
|
31
|
-
return output;
|
|
32
|
-
}
|
|
33
|
-
var NativeSQLiteDatabase = class {
|
|
34
|
-
constructor(database) {
|
|
35
|
-
this.database = database;
|
|
36
|
-
}
|
|
37
|
-
execute(query, parameters) {
|
|
38
|
-
return this.database.execute(query, toPluginParameters(parameters));
|
|
39
|
-
}
|
|
40
|
-
async select(query, parameters) {
|
|
41
|
-
return (await this.database.select(query, toPluginParameters(parameters))).map(toSQLiteRow);
|
|
42
|
-
}
|
|
43
|
-
async get(query, parameters) {
|
|
44
|
-
const row = await this.database.get(query, toPluginParameters(parameters));
|
|
45
|
-
return row ? toSQLiteRow(row) : void 0;
|
|
46
|
-
}
|
|
47
|
-
transaction(action) {
|
|
48
|
-
return this.database.transaction(action);
|
|
49
|
-
}
|
|
50
|
-
close() {
|
|
51
|
-
this.database.close();
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
function openNativeSQLiteDatabase(name = "bleam.sqlite3") {
|
|
55
|
-
const path = databasePath(name);
|
|
56
|
-
const existing = databases.get(path);
|
|
57
|
-
if (existing) return new NativeSQLiteDatabase(existing);
|
|
58
|
-
const database = openOrCreate(path);
|
|
59
|
-
databases.set(path, database);
|
|
60
|
-
return new NativeSQLiteDatabase(database);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
//#endregion
|
|
64
|
-
export { NativeSQLiteDatabase, openNativeSQLiteDatabase };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|