react-native-ariel 0.1.0-dev.1
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/Ariel.podspec +44 -0
- package/LICENSE +20 -0
- package/README.md +349 -0
- package/android/CMakeLists.txt +79 -0
- package/android/build.gradle +144 -0
- package/android/cpp-adapter.cpp +43 -0
- package/android/generated/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeArielSpec.java +41 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/ArielSpec-generated.cpp +38 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/ArielSpec.h +31 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/CMakeLists.txt +28 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/ArielSpec/ArielSpecJSI.h +45 -0
- package/android/src/main/AndroidManifest.xml +5 -0
- package/android/src/main/java/com/ariel/ArielModule.kt +43 -0
- package/android/src/main/java/com/ariel/ArielPackage.kt +34 -0
- package/android/src/main/jniLibs/arm64-v8a/libmermaid_wrapper.a +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libmermaid_wrapper.a +0 -0
- package/android/src/main/jniLibs/x86/libmermaid_wrapper.a +0 -0
- package/android/src/main/jniLibs/x86_64/libmermaid_wrapper.a +0 -0
- package/cpp/mermaid_wrapper.cpp +2368 -0
- package/cpp/mermaid_wrapper.hpp +77 -0
- package/cpp/react-native-ariel.cpp +16 -0
- package/cpp/react-native-ariel.h +15 -0
- package/ios/Ariel.h +16 -0
- package/ios/Ariel.mm +66 -0
- package/ios/generated/build/generated/ios/ReactCodegen/ArielSpec/ArielSpec-generated.mm +46 -0
- package/ios/generated/build/generated/ios/ReactCodegen/ArielSpec/ArielSpec.h +63 -0
- package/ios/generated/build/generated/ios/ReactCodegen/ArielSpecJSI.h +45 -0
- package/lib/module/NativeAriel.js +7 -0
- package/lib/module/NativeAriel.js.map +1 -0
- package/lib/module/generated/rn/mermaid_wrapper-ffi.js +47 -0
- package/lib/module/generated/rn/mermaid_wrapper-ffi.js.map +1 -0
- package/lib/module/generated/rn/mermaid_wrapper.js +487 -0
- package/lib/module/generated/rn/mermaid_wrapper.js.map +1 -0
- package/lib/module/generated/web/mermaid_wrapper.js +532 -0
- package/lib/module/generated/web/mermaid_wrapper.js.map +1 -0
- package/lib/module/index.js +43 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/index.web.js +28 -0
- package/lib/module/index.web.js.map +2 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeAriel.d.ts +8 -0
- package/lib/typescript/src/NativeAriel.d.ts.map +1 -0
- package/lib/typescript/src/generated/rn/mermaid_wrapper-ffi.d.ts +102 -0
- package/lib/typescript/src/generated/rn/mermaid_wrapper-ffi.d.ts.map +1 -0
- package/lib/typescript/src/generated/rn/mermaid_wrapper.d.ts +291 -0
- package/lib/typescript/src/generated/rn/mermaid_wrapper.d.ts.map +1 -0
- package/lib/typescript/src/generated/web/mermaid_wrapper.d.ts +291 -0
- package/lib/typescript/src/generated/web/mermaid_wrapper.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +8 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/index.web.d.ts +8 -0
- package/lib/typescript/src/index.web.d.ts.map +1 -0
- package/package.json +146 -0
- package/react-native.config.js +15 -0
- package/src/NativeAriel.ts +10 -0
- package/src/generated/rn/mermaid_wrapper-ffi.ts +161 -0
- package/src/generated/rn/mermaid_wrapper.ts +765 -0
- package/src/generated/web/mermaid_wrapper.ts +771 -0
- package/src/index.tsx +41 -0
- package/src/index.web.ts +26 -0
- package/src/index.web.tsx +17 -0
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { type UniffiByteArray, type UniffiGcObject, type UniffiHandle, FfiConverterObject, RustBuffer, UniffiAbstractObject, destructorGuardSymbol, pointerLiteralSymbol, uniffiTypeNameSymbol } from "uniffi-bindgen-react-native";
|
|
2
|
+
export declare function computeDiagramLayout(parsed: ArielParsedDiagramLike, theme: ArielThemeLike, config: ArielLayoutConfig): ArielLayoutLike;
|
|
3
|
+
export declare function parseDiagram(input: string): ArielParsedDiagramLike;
|
|
4
|
+
export declare function renderMermaid(input: string): string;
|
|
5
|
+
export declare function renderMermaidWithOptions(input: string, theme: ArielThemeLike, config: ArielLayoutConfig): string;
|
|
6
|
+
export declare function renderMermaidWithTiming(input: string, theme: ArielThemeLike, config: ArielLayoutConfig): ArielRenderResult;
|
|
7
|
+
export declare function renderSvgFromLayout(layout: ArielLayoutLike, theme: ArielThemeLike, config: ArielLayoutConfig): string;
|
|
8
|
+
export declare function setTimingLogs(enabled: boolean): void;
|
|
9
|
+
export type ArielLayoutConfig = {
|
|
10
|
+
nodeSpacing?: number;
|
|
11
|
+
rankSpacing?: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Generated factory for {@link ArielLayoutConfig} record objects.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ArielLayoutConfig: Readonly<{
|
|
17
|
+
create: (partial: Partial<ArielLayoutConfig> & Required<Omit<ArielLayoutConfig, "nodeSpacing" | "rankSpacing">>) => ArielLayoutConfig;
|
|
18
|
+
new: (partial: Partial<ArielLayoutConfig> & Required<Omit<ArielLayoutConfig, "nodeSpacing" | "rankSpacing">>) => ArielLayoutConfig;
|
|
19
|
+
defaults: () => Partial<ArielLayoutConfig>;
|
|
20
|
+
}>;
|
|
21
|
+
export type ArielRenderResult = {
|
|
22
|
+
svg: string;
|
|
23
|
+
parseUs: bigint;
|
|
24
|
+
layoutUs: bigint;
|
|
25
|
+
renderUs: bigint;
|
|
26
|
+
totalMs: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Generated factory for {@link ArielRenderResult} record objects.
|
|
30
|
+
*/
|
|
31
|
+
export declare const ArielRenderResult: Readonly<{
|
|
32
|
+
create: (partial: Partial<ArielRenderResult> & Required<Omit<ArielRenderResult, never>>) => ArielRenderResult;
|
|
33
|
+
new: (partial: Partial<ArielRenderResult> & Required<Omit<ArielRenderResult, never>>) => ArielRenderResult;
|
|
34
|
+
defaults: () => Partial<ArielRenderResult>;
|
|
35
|
+
}>;
|
|
36
|
+
export declare enum MermaidError_Tags {
|
|
37
|
+
RenderError = "RenderError"
|
|
38
|
+
}
|
|
39
|
+
export declare const MermaidError: Readonly<{
|
|
40
|
+
instanceOf: (obj: any) => obj is MermaidError;
|
|
41
|
+
RenderError: {
|
|
42
|
+
new (inner: {
|
|
43
|
+
message: string;
|
|
44
|
+
}): {
|
|
45
|
+
readonly tag: MermaidError_Tags.RenderError;
|
|
46
|
+
readonly inner: Readonly<{
|
|
47
|
+
message: string;
|
|
48
|
+
}>;
|
|
49
|
+
/**
|
|
50
|
+
* @private
|
|
51
|
+
* This field is private and should not be used, use `tag` instead.
|
|
52
|
+
*/
|
|
53
|
+
readonly [uniffiTypeNameSymbol]: "MermaidError";
|
|
54
|
+
name: string;
|
|
55
|
+
message: string;
|
|
56
|
+
stack?: string;
|
|
57
|
+
cause?: unknown;
|
|
58
|
+
};
|
|
59
|
+
"new"(inner: {
|
|
60
|
+
message: string;
|
|
61
|
+
}): {
|
|
62
|
+
readonly tag: MermaidError_Tags.RenderError;
|
|
63
|
+
readonly inner: Readonly<{
|
|
64
|
+
message: string;
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* @private
|
|
68
|
+
* This field is private and should not be used, use `tag` instead.
|
|
69
|
+
*/
|
|
70
|
+
readonly [uniffiTypeNameSymbol]: "MermaidError";
|
|
71
|
+
name: string;
|
|
72
|
+
message: string;
|
|
73
|
+
stack?: string;
|
|
74
|
+
cause?: unknown;
|
|
75
|
+
};
|
|
76
|
+
instanceOf(obj: any): obj is {
|
|
77
|
+
readonly tag: MermaidError_Tags.RenderError;
|
|
78
|
+
readonly inner: Readonly<{
|
|
79
|
+
message: string;
|
|
80
|
+
}>;
|
|
81
|
+
/**
|
|
82
|
+
* @private
|
|
83
|
+
* This field is private and should not be used, use `tag` instead.
|
|
84
|
+
*/
|
|
85
|
+
readonly [uniffiTypeNameSymbol]: "MermaidError";
|
|
86
|
+
name: string;
|
|
87
|
+
message: string;
|
|
88
|
+
stack?: string;
|
|
89
|
+
cause?: unknown;
|
|
90
|
+
};
|
|
91
|
+
hasInner(obj: any): obj is {
|
|
92
|
+
readonly tag: MermaidError_Tags.RenderError;
|
|
93
|
+
readonly inner: Readonly<{
|
|
94
|
+
message: string;
|
|
95
|
+
}>;
|
|
96
|
+
/**
|
|
97
|
+
* @private
|
|
98
|
+
* This field is private and should not be used, use `tag` instead.
|
|
99
|
+
*/
|
|
100
|
+
readonly [uniffiTypeNameSymbol]: "MermaidError";
|
|
101
|
+
name: string;
|
|
102
|
+
message: string;
|
|
103
|
+
stack?: string;
|
|
104
|
+
cause?: unknown;
|
|
105
|
+
};
|
|
106
|
+
getInner(obj: {
|
|
107
|
+
readonly tag: MermaidError_Tags.RenderError;
|
|
108
|
+
readonly inner: Readonly<{
|
|
109
|
+
message: string;
|
|
110
|
+
}>;
|
|
111
|
+
/**
|
|
112
|
+
* @private
|
|
113
|
+
* This field is private and should not be used, use `tag` instead.
|
|
114
|
+
*/
|
|
115
|
+
readonly [uniffiTypeNameSymbol]: "MermaidError";
|
|
116
|
+
name: string;
|
|
117
|
+
message: string;
|
|
118
|
+
stack?: string;
|
|
119
|
+
cause?: unknown;
|
|
120
|
+
}): Readonly<{
|
|
121
|
+
message: string;
|
|
122
|
+
}>;
|
|
123
|
+
isError(error: unknown): error is Error;
|
|
124
|
+
};
|
|
125
|
+
}>;
|
|
126
|
+
export type MermaidError = InstanceType<typeof MermaidError[keyof Omit<typeof MermaidError, 'instanceOf'>]>;
|
|
127
|
+
export interface ArielLayoutLike {
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* @deprecated Use `ArielLayoutLike` instead.
|
|
131
|
+
*/
|
|
132
|
+
export type ArielLayoutInterface = ArielLayoutLike;
|
|
133
|
+
export declare class ArielLayout extends UniffiAbstractObject implements ArielLayoutLike {
|
|
134
|
+
readonly [uniffiTypeNameSymbol] = "ArielLayout";
|
|
135
|
+
readonly [destructorGuardSymbol]: UniffiGcObject;
|
|
136
|
+
readonly [pointerLiteralSymbol]: UniffiHandle;
|
|
137
|
+
private constructor();
|
|
138
|
+
/**
|
|
139
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
140
|
+
*/
|
|
141
|
+
uniffiDestroy(): void;
|
|
142
|
+
static instanceOf(obj: any): obj is ArielLayout;
|
|
143
|
+
}
|
|
144
|
+
export interface ArielParsedDiagramLike {
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* @deprecated Use `ArielParsedDiagramLike` instead.
|
|
148
|
+
*/
|
|
149
|
+
export type ArielParsedDiagramInterface = ArielParsedDiagramLike;
|
|
150
|
+
export declare class ArielParsedDiagram extends UniffiAbstractObject implements ArielParsedDiagramLike {
|
|
151
|
+
readonly [uniffiTypeNameSymbol] = "ArielParsedDiagram";
|
|
152
|
+
readonly [destructorGuardSymbol]: UniffiGcObject;
|
|
153
|
+
readonly [pointerLiteralSymbol]: UniffiHandle;
|
|
154
|
+
private constructor();
|
|
155
|
+
/**
|
|
156
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
157
|
+
*/
|
|
158
|
+
uniffiDestroy(): void;
|
|
159
|
+
static instanceOf(obj: any): obj is ArielParsedDiagram;
|
|
160
|
+
}
|
|
161
|
+
export interface ArielThemeLike {
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* @deprecated Use `ArielThemeLike` instead.
|
|
165
|
+
*/
|
|
166
|
+
export type ArielThemeInterface = ArielThemeLike;
|
|
167
|
+
export declare class ArielTheme extends UniffiAbstractObject implements ArielThemeLike {
|
|
168
|
+
readonly [uniffiTypeNameSymbol] = "ArielTheme";
|
|
169
|
+
readonly [destructorGuardSymbol]: UniffiGcObject;
|
|
170
|
+
readonly [pointerLiteralSymbol]: UniffiHandle;
|
|
171
|
+
private constructor();
|
|
172
|
+
static mermaidDefault(): ArielThemeLike;
|
|
173
|
+
static modern(): ArielThemeLike;
|
|
174
|
+
/**
|
|
175
|
+
* {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
|
|
176
|
+
*/
|
|
177
|
+
uniffiDestroy(): void;
|
|
178
|
+
static instanceOf(obj: any): obj is ArielTheme;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* This should be called before anything else.
|
|
182
|
+
*
|
|
183
|
+
* It is likely that this is being done for you by the library's `index.ts`.
|
|
184
|
+
*
|
|
185
|
+
* It checks versions of uniffi between when the Rust scaffolding was generated
|
|
186
|
+
* and when the bindings were generated.
|
|
187
|
+
*
|
|
188
|
+
* It also initializes the machinery to enable Rust to talk back to Javascript.
|
|
189
|
+
*/
|
|
190
|
+
declare function uniffiEnsureInitialized(): void;
|
|
191
|
+
declare const _default: Readonly<{
|
|
192
|
+
initialize: typeof uniffiEnsureInitialized;
|
|
193
|
+
converters: {
|
|
194
|
+
FfiConverterTypeArielLayout: FfiConverterObject<ArielLayoutLike>;
|
|
195
|
+
FfiConverterTypeArielLayoutConfig: {
|
|
196
|
+
read(from: RustBuffer): ArielLayoutConfig;
|
|
197
|
+
write(value: ArielLayoutConfig, into: RustBuffer): void;
|
|
198
|
+
allocationSize(value: ArielLayoutConfig): number;
|
|
199
|
+
lift(value: UniffiByteArray): ArielLayoutConfig;
|
|
200
|
+
lower(value: ArielLayoutConfig): UniffiByteArray;
|
|
201
|
+
};
|
|
202
|
+
FfiConverterTypeArielParsedDiagram: FfiConverterObject<ArielParsedDiagramLike>;
|
|
203
|
+
FfiConverterTypeArielRenderResult: {
|
|
204
|
+
read(from: RustBuffer): ArielRenderResult;
|
|
205
|
+
write(value: ArielRenderResult, into: RustBuffer): void;
|
|
206
|
+
allocationSize(value: ArielRenderResult): number;
|
|
207
|
+
lift(value: UniffiByteArray): ArielRenderResult;
|
|
208
|
+
lower(value: ArielRenderResult): UniffiByteArray;
|
|
209
|
+
};
|
|
210
|
+
FfiConverterTypeArielTheme: FfiConverterObject<ArielThemeLike>;
|
|
211
|
+
FfiConverterTypeMermaidError: {
|
|
212
|
+
read(from: RustBuffer): {
|
|
213
|
+
readonly tag: MermaidError_Tags.RenderError;
|
|
214
|
+
readonly inner: Readonly<{
|
|
215
|
+
message: string;
|
|
216
|
+
}>;
|
|
217
|
+
/**
|
|
218
|
+
* @private
|
|
219
|
+
* This field is private and should not be used, use `tag` instead.
|
|
220
|
+
*/
|
|
221
|
+
readonly [uniffiTypeNameSymbol]: "MermaidError";
|
|
222
|
+
name: string;
|
|
223
|
+
message: string;
|
|
224
|
+
stack?: string;
|
|
225
|
+
cause?: unknown;
|
|
226
|
+
};
|
|
227
|
+
write(value: {
|
|
228
|
+
readonly tag: MermaidError_Tags.RenderError;
|
|
229
|
+
readonly inner: Readonly<{
|
|
230
|
+
message: string;
|
|
231
|
+
}>;
|
|
232
|
+
/**
|
|
233
|
+
* @private
|
|
234
|
+
* This field is private and should not be used, use `tag` instead.
|
|
235
|
+
*/
|
|
236
|
+
readonly [uniffiTypeNameSymbol]: "MermaidError";
|
|
237
|
+
name: string;
|
|
238
|
+
message: string;
|
|
239
|
+
stack?: string;
|
|
240
|
+
cause?: unknown;
|
|
241
|
+
}, into: RustBuffer): void;
|
|
242
|
+
allocationSize(value: {
|
|
243
|
+
readonly tag: MermaidError_Tags.RenderError;
|
|
244
|
+
readonly inner: Readonly<{
|
|
245
|
+
message: string;
|
|
246
|
+
}>;
|
|
247
|
+
/**
|
|
248
|
+
* @private
|
|
249
|
+
* This field is private and should not be used, use `tag` instead.
|
|
250
|
+
*/
|
|
251
|
+
readonly [uniffiTypeNameSymbol]: "MermaidError";
|
|
252
|
+
name: string;
|
|
253
|
+
message: string;
|
|
254
|
+
stack?: string;
|
|
255
|
+
cause?: unknown;
|
|
256
|
+
}): number;
|
|
257
|
+
lift(value: UniffiByteArray): {
|
|
258
|
+
readonly tag: MermaidError_Tags.RenderError;
|
|
259
|
+
readonly inner: Readonly<{
|
|
260
|
+
message: string;
|
|
261
|
+
}>;
|
|
262
|
+
/**
|
|
263
|
+
* @private
|
|
264
|
+
* This field is private and should not be used, use `tag` instead.
|
|
265
|
+
*/
|
|
266
|
+
readonly [uniffiTypeNameSymbol]: "MermaidError";
|
|
267
|
+
name: string;
|
|
268
|
+
message: string;
|
|
269
|
+
stack?: string;
|
|
270
|
+
cause?: unknown;
|
|
271
|
+
};
|
|
272
|
+
lower(value: {
|
|
273
|
+
readonly tag: MermaidError_Tags.RenderError;
|
|
274
|
+
readonly inner: Readonly<{
|
|
275
|
+
message: string;
|
|
276
|
+
}>;
|
|
277
|
+
/**
|
|
278
|
+
* @private
|
|
279
|
+
* This field is private and should not be used, use `tag` instead.
|
|
280
|
+
*/
|
|
281
|
+
readonly [uniffiTypeNameSymbol]: "MermaidError";
|
|
282
|
+
name: string;
|
|
283
|
+
message: string;
|
|
284
|
+
stack?: string;
|
|
285
|
+
cause?: unknown;
|
|
286
|
+
}): UniffiByteArray;
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
}>;
|
|
290
|
+
export default _default;
|
|
291
|
+
//# sourceMappingURL=mermaid_wrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mermaid_wrapper.d.ts","sourceRoot":"","sources":["../../../../../src/generated/web/mermaid_wrapper.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,YAAY,EAOjB,kBAAkB,EAGlB,UAAU,EACV,oBAAoB,EAIpB,qBAAqB,EACrB,oBAAoB,EAGpB,oBAAoB,EACE,MAAM,6BAA6B,CAAC;AAc5D,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,sBAAsB,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,iBAAiB,GAAG,eAAe,CAWlI;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qBAyD0B,UAAU,GAAG,IAAI;;;gCAtD9B,QAAQ,CAAC;oBAAC,OAAO,EAAE,MAAM,CAAA;iBAAC,CAAC;gBAN3C;;;mBAGG;;;;;;gBAsE8B,MAAM;;;gCAnEvB,QAAQ,CAAC;oBAAC,OAAO,EAAE,MAAM,CAAA;iBAAC,CAAC;gBAN3C;;;mBAGG;;;;;;;;;gCAGa,QAAQ,CAAC;oBAAC,OAAO,EAAE,MAAM,CAAA;iBAAC,CAAC;gBAN3C;;;mBAGG;;;;;;;;;;AAseX,wBAUG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './generated/rn/mermaid_wrapper';
|
|
2
|
+
import * as mermaid_wrapper from './generated/rn/mermaid_wrapper';
|
|
3
|
+
export declare function uniffiInitAsync(): Promise<void>;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
mermaid_wrapper: typeof mermaid_wrapper;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAaA,cAAc,gCAAgC,CAAC;AAK/C,OAAO,KAAK,eAAe,MAAM,gCAAgC,CAAC;AAclE,wBAAsB,eAAe,kBAEpC;;;;AAGD,wBAEE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './generated/web/mermaid_wrapper';
|
|
2
|
+
import * as mermaid_wrapper from './generated/web/mermaid_wrapper';
|
|
3
|
+
export declare function uniffiInitAsync(): Promise<void>;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
mermaid_wrapper: typeof mermaid_wrapper;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=index.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../src/index.web.ts"],"names":[],"mappings":"AAEA,cAAc,iCAAiC,CAAC;AAKhD,OAAO,KAAK,eAAe,MAAM,iCAAiC,CAAC;AAKnE,wBAAsB,eAAe,kBAOpC;;;;AAGD,wBAEE"}
|
package/package.json
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-native-ariel",
|
|
3
|
+
"version": "0.1.0-dev.1",
|
|
4
|
+
"description": "Mermaid diagrams for React Native and React Native Web. No DOM. No WebView. Pure Rust.",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"source": "./src/index.tsx",
|
|
7
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"source": "./src/index.tsx",
|
|
11
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
12
|
+
"default": "./lib/module/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"src",
|
|
18
|
+
"lib",
|
|
19
|
+
"android",
|
|
20
|
+
"ios",
|
|
21
|
+
"cpp",
|
|
22
|
+
"*.podspec",
|
|
23
|
+
"react-native.config.js",
|
|
24
|
+
"!ios/build",
|
|
25
|
+
"!android/build",
|
|
26
|
+
"!android/gradle",
|
|
27
|
+
"!android/gradlew",
|
|
28
|
+
"!android/gradlew.bat",
|
|
29
|
+
"!android/local.properties",
|
|
30
|
+
"!**/__tests__",
|
|
31
|
+
"!**/__fixtures__",
|
|
32
|
+
"!**/__mocks__",
|
|
33
|
+
"!**/.*"
|
|
34
|
+
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"example": "yarn workspace react-native-ariel-example",
|
|
37
|
+
"example:android": "yarn workspace react-native-ariel-example android",
|
|
38
|
+
"example:ios": "yarn workspace react-native-ariel-example ios",
|
|
39
|
+
"example:web": "yarn workspace react-native-ariel-example web",
|
|
40
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
41
|
+
"prepare": "bob build",
|
|
42
|
+
"typecheck": "tsc",
|
|
43
|
+
"test": "jest",
|
|
44
|
+
"ubrn:ios": "ubrn build ios && (cd example/ios && pod install)",
|
|
45
|
+
"ubrn:ios-ci": "ubrn build ios",
|
|
46
|
+
"ubrn:android": "ubrn build android",
|
|
47
|
+
"ubrn:web": "wasm-pack build rust_modules/wasm --target web --out-dir ../../src/generated/web/wasm-bindgen && node scripts/patch-wasm.js",
|
|
48
|
+
"ubrn:web-release": "wasm-pack build rust_modules/wasm --target web --release --out-dir ../../src/generated/web/wasm-bindgen && node scripts/patch-wasm.js",
|
|
49
|
+
"ubrn:checkout": "ubrn checkout",
|
|
50
|
+
"ubrn:clean": "del-cli cpp ios src/generated src/Native* src/index.*ts* src/multiply*",
|
|
51
|
+
"ubrn:generate": "node scripts/generate-bindings.js"
|
|
52
|
+
},
|
|
53
|
+
"keywords": [
|
|
54
|
+
"react-native",
|
|
55
|
+
"ios",
|
|
56
|
+
"android"
|
|
57
|
+
],
|
|
58
|
+
"repository": {
|
|
59
|
+
"type": "git",
|
|
60
|
+
"url": "git+https://github.com/rinfi/ariel.git"
|
|
61
|
+
},
|
|
62
|
+
"author": "Rochanglien Infimate <r.infimate@gmail.com> (https://github.com/rinfi)",
|
|
63
|
+
"license": "MIT",
|
|
64
|
+
"bugs": {
|
|
65
|
+
"url": "https://github.com/rinfi/ariel/issues"
|
|
66
|
+
},
|
|
67
|
+
"homepage": "https://github.com/rinfi/ariel#readme",
|
|
68
|
+
"publishConfig": {
|
|
69
|
+
"registry": "https://registry.npmjs.org/"
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"@jest/globals": "^30.0.0",
|
|
73
|
+
"@react-native-community/cli": "20.1.0",
|
|
74
|
+
"@react-native/babel-preset": "0.85.0",
|
|
75
|
+
"@react-native/jest-preset": "0.85.0",
|
|
76
|
+
"@types/react": "^19.2.0",
|
|
77
|
+
"del-cli": "^7.0.0",
|
|
78
|
+
"jest": "^30.3.0",
|
|
79
|
+
"prettier": "^3.8.3",
|
|
80
|
+
"react": "19.2.3",
|
|
81
|
+
"react-native": "0.85.0",
|
|
82
|
+
"react-native-builder-bob": "^0.41.0",
|
|
83
|
+
"turbo": "^2.8.21",
|
|
84
|
+
"typescript": "^6.0.2"
|
|
85
|
+
},
|
|
86
|
+
"peerDependencies": {
|
|
87
|
+
"react": "*",
|
|
88
|
+
"react-native": "*",
|
|
89
|
+
"react-native-svg": ">=13.0.0"
|
|
90
|
+
},
|
|
91
|
+
"workspaces": [
|
|
92
|
+
"example"
|
|
93
|
+
],
|
|
94
|
+
"packageManager": "yarn@4.11.0",
|
|
95
|
+
"react-native-builder-bob": {
|
|
96
|
+
"source": "src",
|
|
97
|
+
"output": "lib",
|
|
98
|
+
"exclude": "generated/web/wasm-bindgen/**",
|
|
99
|
+
"targets": [
|
|
100
|
+
[
|
|
101
|
+
"module",
|
|
102
|
+
{
|
|
103
|
+
"esm": true
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
[
|
|
107
|
+
"typescript",
|
|
108
|
+
{
|
|
109
|
+
"project": "tsconfig.build.json"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"codegen"
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
"codegenConfig": {
|
|
116
|
+
"name": "ArielSpec",
|
|
117
|
+
"type": "modules",
|
|
118
|
+
"jsSrcsDir": "src",
|
|
119
|
+
"outputDir": {
|
|
120
|
+
"ios": "ios/generated",
|
|
121
|
+
"android": "android/generated"
|
|
122
|
+
},
|
|
123
|
+
"android": {
|
|
124
|
+
"javaPackageName": "com.ariel"
|
|
125
|
+
},
|
|
126
|
+
"includesGeneratedCode": false
|
|
127
|
+
},
|
|
128
|
+
"jest": {
|
|
129
|
+
"preset": "@react-native/jest-preset",
|
|
130
|
+
"modulePathIgnorePatterns": [
|
|
131
|
+
"<rootDir>/example/node_modules",
|
|
132
|
+
"<rootDir>/lib/"
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
"create-react-native-library": {
|
|
136
|
+
"type": "turbo-module",
|
|
137
|
+
"languages": "cpp",
|
|
138
|
+
"tools": [
|
|
139
|
+
"jest"
|
|
140
|
+
],
|
|
141
|
+
"version": "0.62.0"
|
|
142
|
+
},
|
|
143
|
+
"dependencies": {
|
|
144
|
+
"uniffi-bindgen-react-native": "^0.31.0-2"
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {import('@react-native-community/cli-types').UserDependencyConfig}
|
|
3
|
+
*/
|
|
4
|
+
module.exports = {
|
|
5
|
+
dependency: {
|
|
6
|
+
platforms: {
|
|
7
|
+
android: {
|
|
8
|
+
cmakeListsPath: 'generated/jni/CMakeLists.txt',
|
|
9
|
+
cxxModuleCMakeListsModuleName: 'react-native-ariel',
|
|
10
|
+
cxxModuleCMakeListsPath: 'CMakeLists.txt',
|
|
11
|
+
cxxModuleHeaderName: 'ArielImpl',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Generated by uniffi-bindgen-react-native
|
|
2
|
+
import type { TurboModule } from 'react-native';
|
|
3
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
+
|
|
5
|
+
export interface Spec extends TurboModule {
|
|
6
|
+
installRustCrate(): boolean;
|
|
7
|
+
cleanupRustCrate(): boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('Ariel');
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
|
|
2
|
+
// Trust me, you don't want to mess with it!
|
|
3
|
+
|
|
4
|
+
/* tslint:disable */
|
|
5
|
+
/* eslint-disable */
|
|
6
|
+
// @ts-nocheck
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
type StructuralEquality as UniffiStructuralEquality,
|
|
10
|
+
type UniffiForeignFuture as RuntimeUniffiForeignFuture,
|
|
11
|
+
type UniffiRustCallStatus,
|
|
12
|
+
type UniffiGcObject,
|
|
13
|
+
type UniffiRustFutureContinuationCallback as RuntimeUniffiRustFutureContinuationCallback,
|
|
14
|
+
type UniffiResult,
|
|
15
|
+
} from 'uniffi-bindgen-react-native';
|
|
16
|
+
|
|
17
|
+
interface NativeModuleInterface {
|
|
18
|
+
ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(string: string, uniffi_out_err: UniffiRustCallStatus): number;
|
|
19
|
+
ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(string: string, uniffi_out_err: UniffiRustCallStatus): Uint8Array;
|
|
20
|
+
ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(buffer: Uint8Array, uniffi_out_err: UniffiRustCallStatus): string;
|
|
21
|
+
ubrn_uniffi_mermaid_wrapper_fn_clone_ariellayout(handle: bigint, uniffi_out_err: UniffiRustCallStatus): bigint;
|
|
22
|
+
ubrn_uniffi_mermaid_wrapper_fn_free_ariellayout(handle: bigint, uniffi_out_err: UniffiRustCallStatus): void;
|
|
23
|
+
ubrn_uniffi_mermaid_wrapper_fn_clone_arielparseddiagram(handle: bigint, uniffi_out_err: UniffiRustCallStatus): bigint;
|
|
24
|
+
ubrn_uniffi_mermaid_wrapper_fn_free_arielparseddiagram(handle: bigint, uniffi_out_err: UniffiRustCallStatus): void;
|
|
25
|
+
ubrn_uniffi_mermaid_wrapper_fn_clone_arieltheme(handle: bigint, uniffi_out_err: UniffiRustCallStatus): bigint;
|
|
26
|
+
ubrn_uniffi_mermaid_wrapper_fn_free_arieltheme(handle: bigint, uniffi_out_err: UniffiRustCallStatus): void;
|
|
27
|
+
ubrn_uniffi_mermaid_wrapper_fn_constructor_arieltheme_mermaid_default(uniffi_out_err: UniffiRustCallStatus): bigint;
|
|
28
|
+
ubrn_uniffi_mermaid_wrapper_fn_constructor_arieltheme_modern(uniffi_out_err: UniffiRustCallStatus): bigint;
|
|
29
|
+
ubrn_uniffi_mermaid_wrapper_fn_func_compute_diagram_layout(parsed: bigint, theme: bigint, config: Uint8Array, uniffi_out_err: UniffiRustCallStatus): bigint;
|
|
30
|
+
ubrn_uniffi_mermaid_wrapper_fn_func_parse_diagram(input: Uint8Array, uniffi_out_err: UniffiRustCallStatus): bigint;
|
|
31
|
+
ubrn_uniffi_mermaid_wrapper_fn_func_render_mermaid(input: Uint8Array, uniffi_out_err: UniffiRustCallStatus): Uint8Array;
|
|
32
|
+
ubrn_uniffi_mermaid_wrapper_fn_func_render_mermaid_with_options(input: Uint8Array, theme: bigint, config: Uint8Array, uniffi_out_err: UniffiRustCallStatus): Uint8Array;
|
|
33
|
+
ubrn_uniffi_mermaid_wrapper_fn_func_render_mermaid_with_timing(input: Uint8Array, theme: bigint, config: Uint8Array, uniffi_out_err: UniffiRustCallStatus): Uint8Array;
|
|
34
|
+
ubrn_uniffi_mermaid_wrapper_fn_func_render_svg_from_layout(layout: bigint, theme: bigint, config: Uint8Array, uniffi_out_err: UniffiRustCallStatus): Uint8Array;
|
|
35
|
+
ubrn_uniffi_mermaid_wrapper_fn_func_set_timing_logs(enabled: number, uniffi_out_err: UniffiRustCallStatus): void;
|
|
36
|
+
ubrn_uniffi_mermaid_wrapper_checksum_func_compute_diagram_layout(): number;
|
|
37
|
+
ubrn_uniffi_mermaid_wrapper_checksum_func_parse_diagram(): number;
|
|
38
|
+
ubrn_uniffi_mermaid_wrapper_checksum_func_render_mermaid(): number;
|
|
39
|
+
ubrn_uniffi_mermaid_wrapper_checksum_func_render_mermaid_with_options(): number;
|
|
40
|
+
ubrn_uniffi_mermaid_wrapper_checksum_func_render_mermaid_with_timing(): number;
|
|
41
|
+
ubrn_uniffi_mermaid_wrapper_checksum_func_render_svg_from_layout(): number;
|
|
42
|
+
ubrn_uniffi_mermaid_wrapper_checksum_func_set_timing_logs(): number;
|
|
43
|
+
ubrn_uniffi_mermaid_wrapper_checksum_constructor_arieltheme_mermaid_default(): number;
|
|
44
|
+
ubrn_uniffi_mermaid_wrapper_checksum_constructor_arieltheme_modern(): number;
|
|
45
|
+
ubrn_ffi_mermaid_wrapper_uniffi_contract_version(): number;
|
|
46
|
+
ubrn_uniffi_internal_fn_method_ariellayout_ffi__bless_pointer(pointer: bigint, uniffi_out_err: UniffiRustCallStatus): UniffiGcObject;
|
|
47
|
+
ubrn_uniffi_internal_fn_method_arielparseddiagram_ffi__bless_pointer(pointer: bigint, uniffi_out_err: UniffiRustCallStatus): UniffiGcObject;
|
|
48
|
+
ubrn_uniffi_internal_fn_method_arieltheme_ffi__bless_pointer(pointer: bigint, uniffi_out_err: UniffiRustCallStatus): UniffiGcObject;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Casting globalThis to any allows us to look for `NativeMermaidWrapper`
|
|
52
|
+
// if it was added via JSI.
|
|
53
|
+
//
|
|
54
|
+
// We use a getter here rather than simply `globalThis.NativeMermaidWrapper` so that
|
|
55
|
+
// if/when the startup sequence isn't just so, an empty value isn't inadvertantly cached.
|
|
56
|
+
const getter: () => NativeModuleInterface = () => (globalThis as any).NativeMermaidWrapper;
|
|
57
|
+
export default getter;
|
|
58
|
+
|
|
59
|
+
// Structs and function types for calling back into Typescript from Rust.
|
|
60
|
+
export type UniffiRustFutureContinuationCallback = (data: bigint, pollResult: number) => void;
|
|
61
|
+
export type UniffiForeignFutureDroppedCallback = (handle: bigint) => void;
|
|
62
|
+
type UniffiCallbackInterfaceFree = (handle: bigint) => void;
|
|
63
|
+
type UniffiCallbackInterfaceClone = (handle: bigint) => UniffiResult<void>
|
|
64
|
+
;
|
|
65
|
+
export type UniffiForeignFutureDroppedCallbackStruct = {
|
|
66
|
+
handle: bigint;
|
|
67
|
+
free: UniffiForeignFutureDroppedCallback;
|
|
68
|
+
};
|
|
69
|
+
export type UniffiForeignFutureResultU8 = {
|
|
70
|
+
returnValue: number;
|
|
71
|
+
callStatus: UniffiRustCallStatus;
|
|
72
|
+
};
|
|
73
|
+
export type UniffiForeignFutureCompleteU8 = (callbackData: bigint, result: UniffiForeignFutureResultU8) => void;
|
|
74
|
+
export type UniffiForeignFutureResultI8 = {
|
|
75
|
+
returnValue: number;
|
|
76
|
+
callStatus: UniffiRustCallStatus;
|
|
77
|
+
};
|
|
78
|
+
export type UniffiForeignFutureCompleteI8 = (callbackData: bigint, result: UniffiForeignFutureResultI8) => void;
|
|
79
|
+
export type UniffiForeignFutureResultU16 = {
|
|
80
|
+
returnValue: number;
|
|
81
|
+
callStatus: UniffiRustCallStatus;
|
|
82
|
+
};
|
|
83
|
+
export type UniffiForeignFutureCompleteU16 = (callbackData: bigint, result: UniffiForeignFutureResultU16) => void;
|
|
84
|
+
export type UniffiForeignFutureResultI16 = {
|
|
85
|
+
returnValue: number;
|
|
86
|
+
callStatus: UniffiRustCallStatus;
|
|
87
|
+
};
|
|
88
|
+
export type UniffiForeignFutureCompleteI16 = (callbackData: bigint, result: UniffiForeignFutureResultI16) => void;
|
|
89
|
+
export type UniffiForeignFutureResultU32 = {
|
|
90
|
+
returnValue: number;
|
|
91
|
+
callStatus: UniffiRustCallStatus;
|
|
92
|
+
};
|
|
93
|
+
export type UniffiForeignFutureCompleteU32 = (callbackData: bigint, result: UniffiForeignFutureResultU32) => void;
|
|
94
|
+
export type UniffiForeignFutureResultI32 = {
|
|
95
|
+
returnValue: number;
|
|
96
|
+
callStatus: UniffiRustCallStatus;
|
|
97
|
+
};
|
|
98
|
+
export type UniffiForeignFutureCompleteI32 = (callbackData: bigint, result: UniffiForeignFutureResultI32) => void;
|
|
99
|
+
export type UniffiForeignFutureResultU64 = {
|
|
100
|
+
returnValue: bigint;
|
|
101
|
+
callStatus: UniffiRustCallStatus;
|
|
102
|
+
};
|
|
103
|
+
export type UniffiForeignFutureCompleteU64 = (callbackData: bigint, result: UniffiForeignFutureResultU64) => void;
|
|
104
|
+
export type UniffiForeignFutureResultI64 = {
|
|
105
|
+
returnValue: bigint;
|
|
106
|
+
callStatus: UniffiRustCallStatus;
|
|
107
|
+
};
|
|
108
|
+
export type UniffiForeignFutureCompleteI64 = (callbackData: bigint, result: UniffiForeignFutureResultI64) => void;
|
|
109
|
+
export type UniffiForeignFutureResultF32 = {
|
|
110
|
+
returnValue: number;
|
|
111
|
+
callStatus: UniffiRustCallStatus;
|
|
112
|
+
};
|
|
113
|
+
export type UniffiForeignFutureCompleteF32 = (callbackData: bigint, result: UniffiForeignFutureResultF32) => void;
|
|
114
|
+
export type UniffiForeignFutureResultF64 = {
|
|
115
|
+
returnValue: number;
|
|
116
|
+
callStatus: UniffiRustCallStatus;
|
|
117
|
+
};
|
|
118
|
+
export type UniffiForeignFutureCompleteF64 = (callbackData: bigint, result: UniffiForeignFutureResultF64) => void;
|
|
119
|
+
export type UniffiForeignFutureResultRustBuffer = {
|
|
120
|
+
returnValue: Uint8Array;
|
|
121
|
+
callStatus: UniffiRustCallStatus;
|
|
122
|
+
};
|
|
123
|
+
export type UniffiForeignFutureCompleteRustBuffer = (callbackData: bigint, result: UniffiForeignFutureResultRustBuffer) => void;
|
|
124
|
+
export type UniffiForeignFutureResultVoid = {
|
|
125
|
+
callStatus: UniffiRustCallStatus;
|
|
126
|
+
};
|
|
127
|
+
export type UniffiForeignFutureCompleteVoid = (callbackData: bigint, result: UniffiForeignFutureResultVoid) => void;
|
|
128
|
+
|
|
129
|
+
// UniffiRustFutureContinuationCallback is generated as part of the component interface's
|
|
130
|
+
// ffi_definitions. However, we need it in the runtime.
|
|
131
|
+
// We could:
|
|
132
|
+
// (a) do some complicated template logic to ensure the declaration is not generated here (possible)
|
|
133
|
+
// (b) import the generated declaration into the runtime (m a y b e) or…
|
|
134
|
+
// (c) generate the declaration anyway, and use a different declaration in the runtime.
|
|
135
|
+
//
|
|
136
|
+
// We chose (c) here as the simplest. In addition, we perform a compile time check that
|
|
137
|
+
// the two versions of `UniffiRustFutureContinuationCallback` are structurally equivalent.
|
|
138
|
+
//
|
|
139
|
+
// If you see the error:
|
|
140
|
+
// ```
|
|
141
|
+
// Type 'true' is not assignable to type 'false'.(2322)
|
|
142
|
+
// ```
|
|
143
|
+
// Then a new version of uniffi has changed the signature of the callback. Most likely, code in
|
|
144
|
+
// `typescript/src/async-rust-call.ts` will need to be changed.
|
|
145
|
+
//
|
|
146
|
+
// If you see the error:
|
|
147
|
+
// ```
|
|
148
|
+
// Cannot find name 'UniffiRustFutureContinuationCallback'. Did you mean 'RuntimeUniffiRustFutureContinuationCallback'?(2552)
|
|
149
|
+
// ```
|
|
150
|
+
// then you may not be using callbacks or promises, and uniffi is now not generating Futures and callbacks.
|
|
151
|
+
// You should not generate this if that is the case.
|
|
152
|
+
//
|
|
153
|
+
// ('You' being the bindings generator maintainer).
|
|
154
|
+
const isRustFutureContinuationCallbackTypeCompatible: UniffiStructuralEquality<
|
|
155
|
+
RuntimeUniffiRustFutureContinuationCallback,
|
|
156
|
+
UniffiRustFutureContinuationCallback
|
|
157
|
+
> = true;
|
|
158
|
+
const isUniffiForeignFutureTypeCompatible: UniffiStructuralEquality<
|
|
159
|
+
RuntimeUniffiForeignFuture,
|
|
160
|
+
UniffiForeignFuture
|
|
161
|
+
> = true;
|