@reifydb/console 0.3.0
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/index.d.ts +84 -0
- package/dist/index.js +1675 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +908 -0
- package/package.json +69 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as monaco_editor from 'monaco-editor';
|
|
3
|
+
import { languages, editor } from 'monaco-editor';
|
|
4
|
+
|
|
5
|
+
interface ExecutionResult {
|
|
6
|
+
success: boolean;
|
|
7
|
+
data?: Record<string, unknown>[];
|
|
8
|
+
error?: string;
|
|
9
|
+
executionTime: number;
|
|
10
|
+
}
|
|
11
|
+
interface Executor {
|
|
12
|
+
execute(statement: string): Promise<ExecutionResult>;
|
|
13
|
+
}
|
|
14
|
+
interface HistoryEntry {
|
|
15
|
+
id: string;
|
|
16
|
+
query: string;
|
|
17
|
+
timestamp: number;
|
|
18
|
+
success: boolean;
|
|
19
|
+
rowCount?: number;
|
|
20
|
+
executionTime: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type ConnectionConfig = {
|
|
24
|
+
mode: 'wasm';
|
|
25
|
+
} | {
|
|
26
|
+
mode: 'websocket';
|
|
27
|
+
url: string;
|
|
28
|
+
};
|
|
29
|
+
type RdbTheme = 'light' | 'dark';
|
|
30
|
+
interface ConsoleProps {
|
|
31
|
+
executor: Executor;
|
|
32
|
+
initialCode?: string;
|
|
33
|
+
historyKey?: string;
|
|
34
|
+
connection?: ConnectionConfig;
|
|
35
|
+
theme?: RdbTheme;
|
|
36
|
+
}
|
|
37
|
+
declare function Console({ executor, initialCode, historyKey, connection, theme }: ConsoleProps): react_jsx_runtime.JSX.Element;
|
|
38
|
+
|
|
39
|
+
interface SnippetProps {
|
|
40
|
+
executor: Executor;
|
|
41
|
+
initialCode: string;
|
|
42
|
+
title?: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
className?: string;
|
|
45
|
+
theme?: RdbTheme;
|
|
46
|
+
}
|
|
47
|
+
declare function Snippet({ executor, initialCode, title, description, className, theme, }: SnippetProps): react_jsx_runtime.JSX.Element;
|
|
48
|
+
|
|
49
|
+
interface WasmDB {
|
|
50
|
+
admin(rql: string): Promise<unknown> | unknown;
|
|
51
|
+
}
|
|
52
|
+
declare class WasmExecutor implements Executor {
|
|
53
|
+
private db;
|
|
54
|
+
constructor(db: WasmDB);
|
|
55
|
+
execute(statement: string): Promise<ExecutionResult>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface WsClient {
|
|
59
|
+
admin<const S extends readonly unknown[]>(statements: string | string[], params: unknown, schemas: S): Promise<unknown[][]>;
|
|
60
|
+
}
|
|
61
|
+
declare class WsExecutor implements Executor {
|
|
62
|
+
private client;
|
|
63
|
+
constructor(client: WsClient);
|
|
64
|
+
execute(statement: string): Promise<ExecutionResult>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
declare const rqlLanguageDefinition: languages.IMonarchLanguage;
|
|
68
|
+
declare const rqlLanguageConfiguration: languages.LanguageConfiguration;
|
|
69
|
+
|
|
70
|
+
declare const brutalistLightTheme: editor.IStandaloneThemeData;
|
|
71
|
+
declare const brutalistDarkTheme: editor.IStandaloneThemeData;
|
|
72
|
+
declare const premiumLightTheme: editor.IStandaloneThemeData;
|
|
73
|
+
declare const premiumDarkTheme: editor.IStandaloneThemeData;
|
|
74
|
+
|
|
75
|
+
declare function registerRqlLanguage(monaco: typeof monaco_editor): void;
|
|
76
|
+
|
|
77
|
+
interface ValueStyle {
|
|
78
|
+
color?: string;
|
|
79
|
+
italic?: boolean;
|
|
80
|
+
}
|
|
81
|
+
declare function getValueStyle(value: unknown): ValueStyle;
|
|
82
|
+
declare function formatValue(value: unknown): string;
|
|
83
|
+
|
|
84
|
+
export { type ConnectionConfig, Console, type ConsoleProps, type ExecutionResult, type Executor, type HistoryEntry, type RdbTheme, Snippet, type SnippetProps, type WasmDB, WasmExecutor, type WsClient, WsExecutor, brutalistDarkTheme, brutalistLightTheme, formatValue, getValueStyle, premiumDarkTheme, premiumLightTheme, registerRqlLanguage, rqlLanguageConfiguration, rqlLanguageDefinition };
|