@apps-in-toss/plugins 0.0.0-dev.1743134070910

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.
@@ -0,0 +1,96 @@
1
+ import { BedrockPluginCore } from 'react-native-bedrock/config';
2
+ import typia, { tags } from 'typia';
3
+
4
+ type PermissionReadWrite = 'read' | 'write';
5
+ type PermissionAccess = 'access';
6
+ type ClipboardPermission = {
7
+ name: 'clipboard';
8
+ access: PermissionReadWrite;
9
+ };
10
+ type GeolocationPermission = {
11
+ name: 'geolocation';
12
+ access: PermissionAccess;
13
+ };
14
+ type ContactsPermission = {
15
+ name: 'contacts';
16
+ access: PermissionReadWrite;
17
+ };
18
+ type PhotosPermission = {
19
+ name: 'photos';
20
+ access: PermissionReadWrite;
21
+ };
22
+ type CameraPermission = {
23
+ name: 'camera';
24
+ access: PermissionAccess;
25
+ };
26
+ type Permission = ClipboardPermission | GeolocationPermission | ContactsPermission | PhotosPermission | CameraPermission;
27
+ type AppManifest = {
28
+ appName: string;
29
+ permissions: Permission[];
30
+ _metadata: {
31
+ bundleFiles: string[];
32
+ deploymentId: string & tags.Format<'uuid'>;
33
+ };
34
+ };
35
+ declare const validateAppManifest: (input: unknown) => typia.IValidation<AppManifest>;
36
+ interface AppsInTossPluginOptions {
37
+ brand: {
38
+ displayName: string;
39
+ primaryColor: string;
40
+ icon: string;
41
+ bridgeColorMode: BridgeTheme;
42
+ };
43
+ permissions: AppManifest['permissions'];
44
+ }
45
+ /**
46
+ * - `basic`: 기본 테마 (흰 배경)
47
+ * - `inverted`: 반전 테마 (검은 배경)
48
+ */
49
+ type BridgeTheme = 'basic' | 'inverted';
50
+
51
+ declare function appsInTossEsbuildConfig(envScript: string): BedrockPluginCore;
52
+ declare function appsInTossMetroConfig(envScriptPath: string): BedrockPluginCore;
53
+ declare function appsInTossAppJson(options: Pick<AppsInTossPluginOptions, 'permissions'>): Promise<BedrockPluginCore>;
54
+ declare function appsInToss(options: AppsInTossPluginOptions): (BedrockPluginCore | Promise<BedrockPluginCore>)[];
55
+
56
+ interface CompileHbcOptions {
57
+ outdir: string;
58
+ filePath: string;
59
+ }
60
+ type CompileHbcFunc = (options: CompileHbcOptions) => Promise<{
61
+ outfile: string;
62
+ }>;
63
+
64
+ interface CreateCompressedBytecodeDependencies {
65
+ compileHbcFn: CompileHbcFunc;
66
+ }
67
+
68
+ type BuildResult = {
69
+ jsFile: string;
70
+ platform: 'ios' | 'android';
71
+ };
72
+ interface CreateArtifactOptions {
73
+ inputJsFiles: {
74
+ path: string;
75
+ platform: 'ios' | 'android';
76
+ }[];
77
+ reactNativeVersion: `${string}_${string}_${string}`;
78
+ appJsonPath: string;
79
+ outfile: string;
80
+ deploymentId: string;
81
+ additionalFilesToZip?: {
82
+ path: string;
83
+ name: string;
84
+ }[];
85
+ }
86
+ declare function validateZip(zipPath: string): Promise<void>;
87
+ declare function createArtifact(options: CreateArtifactOptions, deps: CreateCompressedBytecodeDependencies): Promise<string>;
88
+
89
+ declare function setupRuntimeSetupScript(config: Pick<AppsInTossPluginOptions, 'brand'> & {
90
+ deploymentId: string;
91
+ }): {
92
+ contents: string;
93
+ path: string;
94
+ };
95
+
96
+ export { type AppManifest, type AppsInTossPluginOptions, type BridgeTheme, type BuildResult, type CreateArtifactOptions, type Permission, appsInToss, appsInTossAppJson, appsInTossEsbuildConfig, appsInTossMetroConfig, createArtifact, setupRuntimeSetupScript, validateAppManifest, validateZip };
@@ -0,0 +1,96 @@
1
+ import { BedrockPluginCore } from 'react-native-bedrock/config';
2
+ import typia, { tags } from 'typia';
3
+
4
+ type PermissionReadWrite = 'read' | 'write';
5
+ type PermissionAccess = 'access';
6
+ type ClipboardPermission = {
7
+ name: 'clipboard';
8
+ access: PermissionReadWrite;
9
+ };
10
+ type GeolocationPermission = {
11
+ name: 'geolocation';
12
+ access: PermissionAccess;
13
+ };
14
+ type ContactsPermission = {
15
+ name: 'contacts';
16
+ access: PermissionReadWrite;
17
+ };
18
+ type PhotosPermission = {
19
+ name: 'photos';
20
+ access: PermissionReadWrite;
21
+ };
22
+ type CameraPermission = {
23
+ name: 'camera';
24
+ access: PermissionAccess;
25
+ };
26
+ type Permission = ClipboardPermission | GeolocationPermission | ContactsPermission | PhotosPermission | CameraPermission;
27
+ type AppManifest = {
28
+ appName: string;
29
+ permissions: Permission[];
30
+ _metadata: {
31
+ bundleFiles: string[];
32
+ deploymentId: string & tags.Format<'uuid'>;
33
+ };
34
+ };
35
+ declare const validateAppManifest: (input: unknown) => typia.IValidation<AppManifest>;
36
+ interface AppsInTossPluginOptions {
37
+ brand: {
38
+ displayName: string;
39
+ primaryColor: string;
40
+ icon: string;
41
+ bridgeColorMode: BridgeTheme;
42
+ };
43
+ permissions: AppManifest['permissions'];
44
+ }
45
+ /**
46
+ * - `basic`: 기본 테마 (흰 배경)
47
+ * - `inverted`: 반전 테마 (검은 배경)
48
+ */
49
+ type BridgeTheme = 'basic' | 'inverted';
50
+
51
+ declare function appsInTossEsbuildConfig(envScript: string): BedrockPluginCore;
52
+ declare function appsInTossMetroConfig(envScriptPath: string): BedrockPluginCore;
53
+ declare function appsInTossAppJson(options: Pick<AppsInTossPluginOptions, 'permissions'>): Promise<BedrockPluginCore>;
54
+ declare function appsInToss(options: AppsInTossPluginOptions): (BedrockPluginCore | Promise<BedrockPluginCore>)[];
55
+
56
+ interface CompileHbcOptions {
57
+ outdir: string;
58
+ filePath: string;
59
+ }
60
+ type CompileHbcFunc = (options: CompileHbcOptions) => Promise<{
61
+ outfile: string;
62
+ }>;
63
+
64
+ interface CreateCompressedBytecodeDependencies {
65
+ compileHbcFn: CompileHbcFunc;
66
+ }
67
+
68
+ type BuildResult = {
69
+ jsFile: string;
70
+ platform: 'ios' | 'android';
71
+ };
72
+ interface CreateArtifactOptions {
73
+ inputJsFiles: {
74
+ path: string;
75
+ platform: 'ios' | 'android';
76
+ }[];
77
+ reactNativeVersion: `${string}_${string}_${string}`;
78
+ appJsonPath: string;
79
+ outfile: string;
80
+ deploymentId: string;
81
+ additionalFilesToZip?: {
82
+ path: string;
83
+ name: string;
84
+ }[];
85
+ }
86
+ declare function validateZip(zipPath: string): Promise<void>;
87
+ declare function createArtifact(options: CreateArtifactOptions, deps: CreateCompressedBytecodeDependencies): Promise<string>;
88
+
89
+ declare function setupRuntimeSetupScript(config: Pick<AppsInTossPluginOptions, 'brand'> & {
90
+ deploymentId: string;
91
+ }): {
92
+ contents: string;
93
+ path: string;
94
+ };
95
+
96
+ export { type AppManifest, type AppsInTossPluginOptions, type BridgeTheme, type BuildResult, type CreateArtifactOptions, type Permission, appsInToss, appsInTossAppJson, appsInTossEsbuildConfig, appsInTossMetroConfig, createArtifact, setupRuntimeSetupScript, validateAppManifest, validateZip };