@capacitor-mlkit/genai-proofreading 8.1.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.
Files changed (36) hide show
  1. package/CapacitorMlkitGenaiProofreading.podspec +17 -0
  2. package/LICENSE +201 -0
  3. package/README.md +421 -0
  4. package/android/build.gradle +60 -0
  5. package/android/src/main/AndroidManifest.xml +2 -0
  6. package/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/genaiproofreading/GenAiProofreading.java +159 -0
  7. package/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/genaiproofreading/GenAiProofreadingPlugin.java +145 -0
  8. package/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/genaiproofreading/classes/events/DownloadProgressEvent.java +22 -0
  9. package/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/genaiproofreading/classes/events/InferenceProgressEvent.java +23 -0
  10. package/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/genaiproofreading/classes/options/FeatureOptions.java +64 -0
  11. package/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/genaiproofreading/classes/options/ProofreadOptions.java +30 -0
  12. package/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/genaiproofreading/classes/results/CheckFeatureStatusResult.java +37 -0
  13. package/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/genaiproofreading/classes/results/ProofreadResult.java +29 -0
  14. package/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/genaiproofreading/interfaces/Callback.java +5 -0
  15. package/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/genaiproofreading/interfaces/EmptyCallback.java +5 -0
  16. package/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/genaiproofreading/interfaces/NonEmptyResultCallback.java +7 -0
  17. package/android/src/main/java/io/capawesome/capacitorjs/plugins/mlkit/genaiproofreading/interfaces/Result.java +7 -0
  18. package/android/src/main/res/.gitkeep +0 -0
  19. package/dist/docs.json +545 -0
  20. package/dist/esm/definitions.d.ts +228 -0
  21. package/dist/esm/definitions.js +83 -0
  22. package/dist/esm/definitions.js.map +1 -0
  23. package/dist/esm/index.d.ts +4 -0
  24. package/dist/esm/index.js +7 -0
  25. package/dist/esm/index.js.map +1 -0
  26. package/dist/esm/web.d.ts +8 -0
  27. package/dist/esm/web.js +16 -0
  28. package/dist/esm/web.js.map +1 -0
  29. package/dist/plugin.cjs.js +113 -0
  30. package/dist/plugin.cjs.js.map +1 -0
  31. package/dist/plugin.js +116 -0
  32. package/dist/plugin.js.map +1 -0
  33. package/ios/Plugin/GenAiProofreadingPlugin.m +10 -0
  34. package/ios/Plugin/GenAiProofreadingPlugin.swift +21 -0
  35. package/ios/Plugin/Info.plist +24 -0
  36. package/package.json +99 -0
@@ -0,0 +1,228 @@
1
+ import type { PluginListenerHandle } from '@capacitor/core';
2
+ /**
3
+ * @since 8.2.0
4
+ */
5
+ export interface GenAiProofreadingPlugin {
6
+ /**
7
+ * Check the current availability status of the proofreading feature.
8
+ *
9
+ * If the status is `DOWNLOADABLE`, you can download the feature
10
+ * using `downloadFeature(...)`.
11
+ *
12
+ * Only available on Android.
13
+ *
14
+ * @since 8.2.0
15
+ */
16
+ checkFeatureStatus(options?: FeatureOptions): Promise<CheckFeatureStatusResult>;
17
+ /**
18
+ * Download the proofreading feature.
19
+ *
20
+ * The `downloadProgress` event listener will notify you about
21
+ * the download progress. The returned promise resolves when
22
+ * the download is complete or the feature is already available.
23
+ *
24
+ * Only available on Android.
25
+ *
26
+ * @since 8.2.0
27
+ */
28
+ downloadFeature(options?: FeatureOptions): Promise<void>;
29
+ /**
30
+ * Proofread the given text.
31
+ *
32
+ * The `inferenceProgress` event listener will notify you about
33
+ * partial results as they are generated. The returned promise
34
+ * resolves with the full result.
35
+ *
36
+ * Only available on Android.
37
+ *
38
+ * @since 8.2.0
39
+ */
40
+ proofread(options: ProofreadOptions): Promise<ProofreadResult>;
41
+ /**
42
+ * Called while the proofreading feature is being downloaded.
43
+ *
44
+ * Only available on Android.
45
+ *
46
+ * @since 8.2.0
47
+ */
48
+ addListener(eventName: 'downloadProgress', listenerFunc: (event: DownloadProgressEvent) => void): Promise<PluginListenerHandle>;
49
+ /**
50
+ * Called when a new partial result is available during inference.
51
+ *
52
+ * Only available on Android.
53
+ *
54
+ * @since 8.2.0
55
+ */
56
+ addListener(eventName: 'inferenceProgress', listenerFunc: (event: InferenceProgressEvent) => void): Promise<PluginListenerHandle>;
57
+ /**
58
+ * Remove all listeners for this plugin.
59
+ *
60
+ * @since 8.2.0
61
+ */
62
+ removeAllListeners(): Promise<void>;
63
+ }
64
+ /**
65
+ * @since 8.2.0
66
+ */
67
+ export interface CheckFeatureStatusResult {
68
+ /**
69
+ * The current availability status of the proofreading feature.
70
+ *
71
+ * @since 8.2.0
72
+ * @example 'AVAILABLE'
73
+ */
74
+ featureStatus: FeatureStatus;
75
+ }
76
+ /**
77
+ * @since 8.2.0
78
+ */
79
+ export interface DownloadProgressEvent {
80
+ /**
81
+ * The total number of bytes downloaded so far.
82
+ *
83
+ * @since 8.2.0
84
+ * @example 1024
85
+ */
86
+ totalBytesDownloaded: number;
87
+ }
88
+ /**
89
+ * The feature availability depends on the configured input type
90
+ * and language. Therefore, `checkFeatureStatus(...)` and
91
+ * `downloadFeature(...)` take the same base options as `proofread(...)`.
92
+ *
93
+ * @since 8.2.0
94
+ */
95
+ export interface FeatureOptions {
96
+ /**
97
+ * The type of the input text.
98
+ *
99
+ * @since 8.2.0
100
+ * @default InputType.Keyboard
101
+ */
102
+ inputType?: InputType;
103
+ /**
104
+ * The language of the input text.
105
+ *
106
+ * @since 8.2.0
107
+ * @default Language.English
108
+ */
109
+ language?: Language;
110
+ }
111
+ /**
112
+ * @since 8.2.0
113
+ */
114
+ export interface InferenceProgressEvent {
115
+ /**
116
+ * The new text of the partial result.
117
+ *
118
+ * @since 8.2.0
119
+ * @example 'Capacitor is an open source native runtime.'
120
+ */
121
+ text: string;
122
+ }
123
+ /**
124
+ * @since 8.2.0
125
+ */
126
+ export interface ProofreadOptions extends FeatureOptions {
127
+ /**
128
+ * The text to proofread.
129
+ *
130
+ * @since 8.2.0
131
+ * @example 'Capacitor is an open source natvie runtime.'
132
+ */
133
+ text: string;
134
+ }
135
+ /**
136
+ * @since 8.2.0
137
+ */
138
+ export interface ProofreadResult {
139
+ /**
140
+ * The proofread suggestions for the input text.
141
+ *
142
+ * More than one result may be returned. If multiple suggestions are
143
+ * returned, they are sorted in descending order of confidence.
144
+ *
145
+ * @since 8.2.0
146
+ * @example ['Capacitor is an open source native runtime.']
147
+ */
148
+ results: string[];
149
+ }
150
+ /**
151
+ * @since 8.2.0
152
+ */
153
+ export declare enum FeatureStatus {
154
+ /**
155
+ * The feature is available to use.
156
+ *
157
+ * @since 8.2.0
158
+ */
159
+ Available = "AVAILABLE",
160
+ /**
161
+ * The feature can be downloaded using `downloadFeature(...)`.
162
+ *
163
+ * @since 8.2.0
164
+ */
165
+ Downloadable = "DOWNLOADABLE",
166
+ /**
167
+ * The feature is currently being downloaded.
168
+ *
169
+ * @since 8.2.0
170
+ */
171
+ Downloading = "DOWNLOADING",
172
+ /**
173
+ * The feature is not available on this device.
174
+ *
175
+ * @since 8.2.0
176
+ */
177
+ Unavailable = "UNAVAILABLE"
178
+ }
179
+ /**
180
+ * @since 8.2.0
181
+ */
182
+ export declare enum InputType {
183
+ /**
184
+ * The input text was typed on a keyboard.
185
+ *
186
+ * @since 8.2.0
187
+ */
188
+ Keyboard = "KEYBOARD",
189
+ /**
190
+ * The input text was produced by converting voice to text.
191
+ *
192
+ * @since 8.2.0
193
+ */
194
+ Voice = "VOICE"
195
+ }
196
+ /**
197
+ * @since 8.2.0
198
+ */
199
+ export declare enum Language {
200
+ /**
201
+ * @since 8.2.0
202
+ */
203
+ English = "ENGLISH",
204
+ /**
205
+ * @since 8.2.0
206
+ */
207
+ French = "FRENCH",
208
+ /**
209
+ * @since 8.2.0
210
+ */
211
+ German = "GERMAN",
212
+ /**
213
+ * @since 8.2.0
214
+ */
215
+ Italian = "ITALIAN",
216
+ /**
217
+ * @since 8.2.0
218
+ */
219
+ Japanese = "JAPANESE",
220
+ /**
221
+ * @since 8.2.0
222
+ */
223
+ Korean = "KOREAN",
224
+ /**
225
+ * @since 8.2.0
226
+ */
227
+ Spanish = "SPANISH"
228
+ }
@@ -0,0 +1,83 @@
1
+ /**
2
+ * @since 8.2.0
3
+ */
4
+ export var FeatureStatus;
5
+ (function (FeatureStatus) {
6
+ /**
7
+ * The feature is available to use.
8
+ *
9
+ * @since 8.2.0
10
+ */
11
+ FeatureStatus["Available"] = "AVAILABLE";
12
+ /**
13
+ * The feature can be downloaded using `downloadFeature(...)`.
14
+ *
15
+ * @since 8.2.0
16
+ */
17
+ FeatureStatus["Downloadable"] = "DOWNLOADABLE";
18
+ /**
19
+ * The feature is currently being downloaded.
20
+ *
21
+ * @since 8.2.0
22
+ */
23
+ FeatureStatus["Downloading"] = "DOWNLOADING";
24
+ /**
25
+ * The feature is not available on this device.
26
+ *
27
+ * @since 8.2.0
28
+ */
29
+ FeatureStatus["Unavailable"] = "UNAVAILABLE";
30
+ })(FeatureStatus || (FeatureStatus = {}));
31
+ /**
32
+ * @since 8.2.0
33
+ */
34
+ export var InputType;
35
+ (function (InputType) {
36
+ /**
37
+ * The input text was typed on a keyboard.
38
+ *
39
+ * @since 8.2.0
40
+ */
41
+ InputType["Keyboard"] = "KEYBOARD";
42
+ /**
43
+ * The input text was produced by converting voice to text.
44
+ *
45
+ * @since 8.2.0
46
+ */
47
+ InputType["Voice"] = "VOICE";
48
+ })(InputType || (InputType = {}));
49
+ /**
50
+ * @since 8.2.0
51
+ */
52
+ export var Language;
53
+ (function (Language) {
54
+ /**
55
+ * @since 8.2.0
56
+ */
57
+ Language["English"] = "ENGLISH";
58
+ /**
59
+ * @since 8.2.0
60
+ */
61
+ Language["French"] = "FRENCH";
62
+ /**
63
+ * @since 8.2.0
64
+ */
65
+ Language["German"] = "GERMAN";
66
+ /**
67
+ * @since 8.2.0
68
+ */
69
+ Language["Italian"] = "ITALIAN";
70
+ /**
71
+ * @since 8.2.0
72
+ */
73
+ Language["Japanese"] = "JAPANESE";
74
+ /**
75
+ * @since 8.2.0
76
+ */
77
+ Language["Korean"] = "KOREAN";
78
+ /**
79
+ * @since 8.2.0
80
+ */
81
+ Language["Spanish"] = "SPANISH";
82
+ })(Language || (Language = {}));
83
+ //# sourceMappingURL=definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAqKA;;GAEG;AACH,MAAM,CAAN,IAAY,aAyBX;AAzBD,WAAY,aAAa;IACvB;;;;OAIG;IACH,wCAAuB,CAAA;IACvB;;;;OAIG;IACH,8CAA6B,CAAA;IAC7B;;;;OAIG;IACH,4CAA2B,CAAA;IAC3B;;;;OAIG;IACH,4CAA2B,CAAA;AAC7B,CAAC,EAzBW,aAAa,KAAb,aAAa,QAyBxB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,SAaX;AAbD,WAAY,SAAS;IACnB;;;;OAIG;IACH,kCAAqB,CAAA;IACrB;;;;OAIG;IACH,4BAAe,CAAA;AACjB,CAAC,EAbW,SAAS,KAAT,SAAS,QAapB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,QA6BX;AA7BD,WAAY,QAAQ;IAClB;;OAEG;IACH,+BAAmB,CAAA;IACnB;;OAEG;IACH,6BAAiB,CAAA;IACjB;;OAEG;IACH,6BAAiB,CAAA;IACjB;;OAEG;IACH,+BAAmB,CAAA;IACnB;;OAEG;IACH,iCAAqB,CAAA;IACrB;;OAEG;IACH,6BAAiB,CAAA;IACjB;;OAEG;IACH,+BAAmB,CAAA;AACrB,CAAC,EA7BW,QAAQ,KAAR,QAAQ,QA6BnB","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\n/**\n * @since 8.2.0\n */\nexport interface GenAiProofreadingPlugin {\n /**\n * Check the current availability status of the proofreading feature.\n *\n * If the status is `DOWNLOADABLE`, you can download the feature\n * using `downloadFeature(...)`.\n *\n * Only available on Android.\n *\n * @since 8.2.0\n */\n checkFeatureStatus(\n options?: FeatureOptions,\n ): Promise<CheckFeatureStatusResult>;\n /**\n * Download the proofreading feature.\n *\n * The `downloadProgress` event listener will notify you about\n * the download progress. The returned promise resolves when\n * the download is complete or the feature is already available.\n *\n * Only available on Android.\n *\n * @since 8.2.0\n */\n downloadFeature(options?: FeatureOptions): Promise<void>;\n /**\n * Proofread the given text.\n *\n * The `inferenceProgress` event listener will notify you about\n * partial results as they are generated. The returned promise\n * resolves with the full result.\n *\n * Only available on Android.\n *\n * @since 8.2.0\n */\n proofread(options: ProofreadOptions): Promise<ProofreadResult>;\n /**\n * Called while the proofreading feature is being downloaded.\n *\n * Only available on Android.\n *\n * @since 8.2.0\n */\n addListener(\n eventName: 'downloadProgress',\n listenerFunc: (event: DownloadProgressEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Called when a new partial result is available during inference.\n *\n * Only available on Android.\n *\n * @since 8.2.0\n */\n addListener(\n eventName: 'inferenceProgress',\n listenerFunc: (event: InferenceProgressEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Remove all listeners for this plugin.\n *\n * @since 8.2.0\n */\n removeAllListeners(): Promise<void>;\n}\n\n/**\n * @since 8.2.0\n */\nexport interface CheckFeatureStatusResult {\n /**\n * The current availability status of the proofreading feature.\n *\n * @since 8.2.0\n * @example 'AVAILABLE'\n */\n featureStatus: FeatureStatus;\n}\n\n/**\n * @since 8.2.0\n */\nexport interface DownloadProgressEvent {\n /**\n * The total number of bytes downloaded so far.\n *\n * @since 8.2.0\n * @example 1024\n */\n totalBytesDownloaded: number;\n}\n\n/**\n * The feature availability depends on the configured input type\n * and language. Therefore, `checkFeatureStatus(...)` and\n * `downloadFeature(...)` take the same base options as `proofread(...)`.\n *\n * @since 8.2.0\n */\nexport interface FeatureOptions {\n /**\n * The type of the input text.\n *\n * @since 8.2.0\n * @default InputType.Keyboard\n */\n inputType?: InputType;\n /**\n * The language of the input text.\n *\n * @since 8.2.0\n * @default Language.English\n */\n language?: Language;\n}\n\n/**\n * @since 8.2.0\n */\nexport interface InferenceProgressEvent {\n /**\n * The new text of the partial result.\n *\n * @since 8.2.0\n * @example 'Capacitor is an open source native runtime.'\n */\n text: string;\n}\n\n/**\n * @since 8.2.0\n */\nexport interface ProofreadOptions extends FeatureOptions {\n /**\n * The text to proofread.\n *\n * @since 8.2.0\n * @example 'Capacitor is an open source natvie runtime.'\n */\n text: string;\n}\n\n/**\n * @since 8.2.0\n */\nexport interface ProofreadResult {\n /**\n * The proofread suggestions for the input text.\n *\n * More than one result may be returned. If multiple suggestions are\n * returned, they are sorted in descending order of confidence.\n *\n * @since 8.2.0\n * @example ['Capacitor is an open source native runtime.']\n */\n results: string[];\n}\n\n/**\n * @since 8.2.0\n */\nexport enum FeatureStatus {\n /**\n * The feature is available to use.\n *\n * @since 8.2.0\n */\n Available = 'AVAILABLE',\n /**\n * The feature can be downloaded using `downloadFeature(...)`.\n *\n * @since 8.2.0\n */\n Downloadable = 'DOWNLOADABLE',\n /**\n * The feature is currently being downloaded.\n *\n * @since 8.2.0\n */\n Downloading = 'DOWNLOADING',\n /**\n * The feature is not available on this device.\n *\n * @since 8.2.0\n */\n Unavailable = 'UNAVAILABLE',\n}\n\n/**\n * @since 8.2.0\n */\nexport enum InputType {\n /**\n * The input text was typed on a keyboard.\n *\n * @since 8.2.0\n */\n Keyboard = 'KEYBOARD',\n /**\n * The input text was produced by converting voice to text.\n *\n * @since 8.2.0\n */\n Voice = 'VOICE',\n}\n\n/**\n * @since 8.2.0\n */\nexport enum Language {\n /**\n * @since 8.2.0\n */\n English = 'ENGLISH',\n /**\n * @since 8.2.0\n */\n French = 'FRENCH',\n /**\n * @since 8.2.0\n */\n German = 'GERMAN',\n /**\n * @since 8.2.0\n */\n Italian = 'ITALIAN',\n /**\n * @since 8.2.0\n */\n Japanese = 'JAPANESE',\n /**\n * @since 8.2.0\n */\n Korean = 'KOREAN',\n /**\n * @since 8.2.0\n */\n Spanish = 'SPANISH',\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { GenAiProofreadingPlugin } from './definitions';
2
+ declare const GenAiProofreading: GenAiProofreadingPlugin;
3
+ export * from './definitions';
4
+ export { GenAiProofreading };
@@ -0,0 +1,7 @@
1
+ import { registerPlugin } from '@capacitor/core';
2
+ const GenAiProofreading = registerPlugin('GenAiProofreading', {
3
+ web: () => import('./web').then(m => new m.GenAiProofreadingWeb()),
4
+ });
5
+ export * from './definitions';
6
+ export { GenAiProofreading };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,iBAAiB,GAAG,cAAc,CACtC,mBAAmB,EACnB;IACE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;CACnE,CACF,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { GenAiProofreadingPlugin } from './definitions';\n\nconst GenAiProofreading = registerPlugin<GenAiProofreadingPlugin>(\n 'GenAiProofreading',\n {\n web: () => import('./web').then(m => new m.GenAiProofreadingWeb()),\n },\n);\n\nexport * from './definitions';\nexport { GenAiProofreading };\n"]}
@@ -0,0 +1,8 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ import type { CheckFeatureStatusResult, FeatureOptions, GenAiProofreadingPlugin, ProofreadOptions, ProofreadResult } from './definitions';
3
+ export declare class GenAiProofreadingWeb extends WebPlugin implements GenAiProofreadingPlugin {
4
+ checkFeatureStatus(_options?: FeatureOptions): Promise<CheckFeatureStatusResult>;
5
+ downloadFeature(_options?: FeatureOptions): Promise<void>;
6
+ proofread(_options: ProofreadOptions): Promise<ProofreadResult>;
7
+ private createUnimplementedException;
8
+ }
@@ -0,0 +1,16 @@
1
+ import { CapacitorException, ExceptionCode, WebPlugin } from '@capacitor/core';
2
+ export class GenAiProofreadingWeb extends WebPlugin {
3
+ async checkFeatureStatus(_options) {
4
+ throw this.createUnimplementedException();
5
+ }
6
+ async downloadFeature(_options) {
7
+ throw this.createUnimplementedException();
8
+ }
9
+ async proofread(_options) {
10
+ throw this.createUnimplementedException();
11
+ }
12
+ createUnimplementedException() {
13
+ return new CapacitorException('This plugin method is not implemented on this platform.', ExceptionCode.Unimplemented);
14
+ }
15
+ }
16
+ //# sourceMappingURL=web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAU/E,MAAM,OAAO,oBACX,SAAQ,SAAS;IAGV,KAAK,CAAC,kBAAkB,CAC7B,QAAyB;QAEzB,MAAM,IAAI,CAAC,4BAA4B,EAAE,CAAC;IAC5C,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,QAAyB;QACpD,MAAM,IAAI,CAAC,4BAA4B,EAAE,CAAC;IAC5C,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,QAA0B;QAC/C,MAAM,IAAI,CAAC,4BAA4B,EAAE,CAAC;IAC5C,CAAC;IAEO,4BAA4B;QAClC,OAAO,IAAI,kBAAkB,CAC3B,yDAAyD,EACzD,aAAa,CAAC,aAAa,CAC5B,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { CapacitorException, ExceptionCode, WebPlugin } from '@capacitor/core';\n\nimport type {\n CheckFeatureStatusResult,\n FeatureOptions,\n GenAiProofreadingPlugin,\n ProofreadOptions,\n ProofreadResult,\n} from './definitions';\n\nexport class GenAiProofreadingWeb\n extends WebPlugin\n implements GenAiProofreadingPlugin\n{\n public async checkFeatureStatus(\n _options?: FeatureOptions,\n ): Promise<CheckFeatureStatusResult> {\n throw this.createUnimplementedException();\n }\n\n public async downloadFeature(_options?: FeatureOptions): Promise<void> {\n throw this.createUnimplementedException();\n }\n\n public async proofread(_options: ProofreadOptions): Promise<ProofreadResult> {\n throw this.createUnimplementedException();\n }\n\n private createUnimplementedException(): CapacitorException {\n return new CapacitorException(\n 'This plugin method is not implemented on this platform.',\n ExceptionCode.Unimplemented,\n );\n }\n}\n"]}
@@ -0,0 +1,113 @@
1
+ 'use strict';
2
+
3
+ var core = require('@capacitor/core');
4
+
5
+ /**
6
+ * @since 8.2.0
7
+ */
8
+ exports.FeatureStatus = void 0;
9
+ (function (FeatureStatus) {
10
+ /**
11
+ * The feature is available to use.
12
+ *
13
+ * @since 8.2.0
14
+ */
15
+ FeatureStatus["Available"] = "AVAILABLE";
16
+ /**
17
+ * The feature can be downloaded using `downloadFeature(...)`.
18
+ *
19
+ * @since 8.2.0
20
+ */
21
+ FeatureStatus["Downloadable"] = "DOWNLOADABLE";
22
+ /**
23
+ * The feature is currently being downloaded.
24
+ *
25
+ * @since 8.2.0
26
+ */
27
+ FeatureStatus["Downloading"] = "DOWNLOADING";
28
+ /**
29
+ * The feature is not available on this device.
30
+ *
31
+ * @since 8.2.0
32
+ */
33
+ FeatureStatus["Unavailable"] = "UNAVAILABLE";
34
+ })(exports.FeatureStatus || (exports.FeatureStatus = {}));
35
+ /**
36
+ * @since 8.2.0
37
+ */
38
+ exports.InputType = void 0;
39
+ (function (InputType) {
40
+ /**
41
+ * The input text was typed on a keyboard.
42
+ *
43
+ * @since 8.2.0
44
+ */
45
+ InputType["Keyboard"] = "KEYBOARD";
46
+ /**
47
+ * The input text was produced by converting voice to text.
48
+ *
49
+ * @since 8.2.0
50
+ */
51
+ InputType["Voice"] = "VOICE";
52
+ })(exports.InputType || (exports.InputType = {}));
53
+ /**
54
+ * @since 8.2.0
55
+ */
56
+ exports.Language = void 0;
57
+ (function (Language) {
58
+ /**
59
+ * @since 8.2.0
60
+ */
61
+ Language["English"] = "ENGLISH";
62
+ /**
63
+ * @since 8.2.0
64
+ */
65
+ Language["French"] = "FRENCH";
66
+ /**
67
+ * @since 8.2.0
68
+ */
69
+ Language["German"] = "GERMAN";
70
+ /**
71
+ * @since 8.2.0
72
+ */
73
+ Language["Italian"] = "ITALIAN";
74
+ /**
75
+ * @since 8.2.0
76
+ */
77
+ Language["Japanese"] = "JAPANESE";
78
+ /**
79
+ * @since 8.2.0
80
+ */
81
+ Language["Korean"] = "KOREAN";
82
+ /**
83
+ * @since 8.2.0
84
+ */
85
+ Language["Spanish"] = "SPANISH";
86
+ })(exports.Language || (exports.Language = {}));
87
+
88
+ const GenAiProofreading = core.registerPlugin('GenAiProofreading', {
89
+ web: () => Promise.resolve().then(function () { return web; }).then(m => new m.GenAiProofreadingWeb()),
90
+ });
91
+
92
+ class GenAiProofreadingWeb extends core.WebPlugin {
93
+ async checkFeatureStatus(_options) {
94
+ throw this.createUnimplementedException();
95
+ }
96
+ async downloadFeature(_options) {
97
+ throw this.createUnimplementedException();
98
+ }
99
+ async proofread(_options) {
100
+ throw this.createUnimplementedException();
101
+ }
102
+ createUnimplementedException() {
103
+ return new core.CapacitorException('This plugin method is not implemented on this platform.', core.ExceptionCode.Unimplemented);
104
+ }
105
+ }
106
+
107
+ var web = /*#__PURE__*/Object.freeze({
108
+ __proto__: null,
109
+ GenAiProofreadingWeb: GenAiProofreadingWeb
110
+ });
111
+
112
+ exports.GenAiProofreading = GenAiProofreading;
113
+ //# sourceMappingURL=plugin.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * @since 8.2.0\n */\nexport var FeatureStatus;\n(function (FeatureStatus) {\n /**\n * The feature is available to use.\n *\n * @since 8.2.0\n */\n FeatureStatus[\"Available\"] = \"AVAILABLE\";\n /**\n * The feature can be downloaded using `downloadFeature(...)`.\n *\n * @since 8.2.0\n */\n FeatureStatus[\"Downloadable\"] = \"DOWNLOADABLE\";\n /**\n * The feature is currently being downloaded.\n *\n * @since 8.2.0\n */\n FeatureStatus[\"Downloading\"] = \"DOWNLOADING\";\n /**\n * The feature is not available on this device.\n *\n * @since 8.2.0\n */\n FeatureStatus[\"Unavailable\"] = \"UNAVAILABLE\";\n})(FeatureStatus || (FeatureStatus = {}));\n/**\n * @since 8.2.0\n */\nexport var InputType;\n(function (InputType) {\n /**\n * The input text was typed on a keyboard.\n *\n * @since 8.2.0\n */\n InputType[\"Keyboard\"] = \"KEYBOARD\";\n /**\n * The input text was produced by converting voice to text.\n *\n * @since 8.2.0\n */\n InputType[\"Voice\"] = \"VOICE\";\n})(InputType || (InputType = {}));\n/**\n * @since 8.2.0\n */\nexport var Language;\n(function (Language) {\n /**\n * @since 8.2.0\n */\n Language[\"English\"] = \"ENGLISH\";\n /**\n * @since 8.2.0\n */\n Language[\"French\"] = \"FRENCH\";\n /**\n * @since 8.2.0\n */\n Language[\"German\"] = \"GERMAN\";\n /**\n * @since 8.2.0\n */\n Language[\"Italian\"] = \"ITALIAN\";\n /**\n * @since 8.2.0\n */\n Language[\"Japanese\"] = \"JAPANESE\";\n /**\n * @since 8.2.0\n */\n Language[\"Korean\"] = \"KOREAN\";\n /**\n * @since 8.2.0\n */\n Language[\"Spanish\"] = \"SPANISH\";\n})(Language || (Language = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst GenAiProofreading = registerPlugin('GenAiProofreading', {\n web: () => import('./web').then(m => new m.GenAiProofreadingWeb()),\n});\nexport * from './definitions';\nexport { GenAiProofreading };\n//# sourceMappingURL=index.js.map","import { CapacitorException, ExceptionCode, WebPlugin } from '@capacitor/core';\nexport class GenAiProofreadingWeb extends WebPlugin {\n async checkFeatureStatus(_options) {\n throw this.createUnimplementedException();\n }\n async downloadFeature(_options) {\n throw this.createUnimplementedException();\n }\n async proofread(_options) {\n throw this.createUnimplementedException();\n }\n createUnimplementedException() {\n return new CapacitorException('This plugin method is not implemented on this platform.', ExceptionCode.Unimplemented);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["FeatureStatus","InputType","Language","registerPlugin","WebPlugin","CapacitorException","ExceptionCode"],"mappings":";;;;AAAA;AACA;AACA;AACWA;AACX,CAAC,UAAU,aAAa,EAAE;AAC1B;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,CAAC,WAAW,CAAC,GAAG,WAAW;AAC5C;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,CAAC,cAAc,CAAC,GAAG,cAAc;AAClD;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,CAAC,aAAa,CAAC,GAAG,aAAa;AAChD;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,CAAC,aAAa,CAAC,GAAG,aAAa;AAChD,CAAC,EAAEA,qBAAa,KAAKA,qBAAa,GAAG,EAAE,CAAC,CAAC;AACzC;AACA;AACA;AACWC;AACX,CAAC,UAAU,SAAS,EAAE;AACtB;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,UAAU;AACtC;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,OAAO;AAChC,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;AACjC;AACA;AACA;AACWC;AACX,CAAC,UAAU,QAAQ,EAAE;AACrB;AACA;AACA;AACA,IAAI,QAAQ,CAAC,SAAS,CAAC,GAAG,SAAS;AACnC;AACA;AACA;AACA,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,QAAQ;AACjC;AACA;AACA;AACA,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,QAAQ;AACjC;AACA;AACA;AACA,IAAI,QAAQ,CAAC,SAAS,CAAC,GAAG,SAAS;AACnC;AACA;AACA;AACA,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,UAAU;AACrC;AACA;AACA;AACA,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,QAAQ;AACjC;AACA;AACA;AACA,IAAI,QAAQ,CAAC,SAAS,CAAC,GAAG,SAAS;AACnC,CAAC,EAAEA,gBAAQ,KAAKA,gBAAQ,GAAG,EAAE,CAAC,CAAC;;AChF1B,MAAC,iBAAiB,GAAGC,mBAAc,CAAC,mBAAmB,EAAE;AAC9D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;AACtE,CAAC;;ACFM,MAAM,oBAAoB,SAASC,cAAS,CAAC;AACpD,IAAI,MAAM,kBAAkB,CAAC,QAAQ,EAAE;AACvC,QAAQ,MAAM,IAAI,CAAC,4BAA4B,EAAE;AACjD,IAAI;AACJ,IAAI,MAAM,eAAe,CAAC,QAAQ,EAAE;AACpC,QAAQ,MAAM,IAAI,CAAC,4BAA4B,EAAE;AACjD,IAAI;AACJ,IAAI,MAAM,SAAS,CAAC,QAAQ,EAAE;AAC9B,QAAQ,MAAM,IAAI,CAAC,4BAA4B,EAAE;AACjD,IAAI;AACJ,IAAI,4BAA4B,GAAG;AACnC,QAAQ,OAAO,IAAIC,uBAAkB,CAAC,yDAAyD,EAAEC,kBAAa,CAAC,aAAa,CAAC;AAC7H,IAAI;AACJ;;;;;;;;;"}
package/dist/plugin.js ADDED
@@ -0,0 +1,116 @@
1
+ var capacitorGenAiProofreading = (function (exports, core) {
2
+ 'use strict';
3
+
4
+ /**
5
+ * @since 8.2.0
6
+ */
7
+ exports.FeatureStatus = void 0;
8
+ (function (FeatureStatus) {
9
+ /**
10
+ * The feature is available to use.
11
+ *
12
+ * @since 8.2.0
13
+ */
14
+ FeatureStatus["Available"] = "AVAILABLE";
15
+ /**
16
+ * The feature can be downloaded using `downloadFeature(...)`.
17
+ *
18
+ * @since 8.2.0
19
+ */
20
+ FeatureStatus["Downloadable"] = "DOWNLOADABLE";
21
+ /**
22
+ * The feature is currently being downloaded.
23
+ *
24
+ * @since 8.2.0
25
+ */
26
+ FeatureStatus["Downloading"] = "DOWNLOADING";
27
+ /**
28
+ * The feature is not available on this device.
29
+ *
30
+ * @since 8.2.0
31
+ */
32
+ FeatureStatus["Unavailable"] = "UNAVAILABLE";
33
+ })(exports.FeatureStatus || (exports.FeatureStatus = {}));
34
+ /**
35
+ * @since 8.2.0
36
+ */
37
+ exports.InputType = void 0;
38
+ (function (InputType) {
39
+ /**
40
+ * The input text was typed on a keyboard.
41
+ *
42
+ * @since 8.2.0
43
+ */
44
+ InputType["Keyboard"] = "KEYBOARD";
45
+ /**
46
+ * The input text was produced by converting voice to text.
47
+ *
48
+ * @since 8.2.0
49
+ */
50
+ InputType["Voice"] = "VOICE";
51
+ })(exports.InputType || (exports.InputType = {}));
52
+ /**
53
+ * @since 8.2.0
54
+ */
55
+ exports.Language = void 0;
56
+ (function (Language) {
57
+ /**
58
+ * @since 8.2.0
59
+ */
60
+ Language["English"] = "ENGLISH";
61
+ /**
62
+ * @since 8.2.0
63
+ */
64
+ Language["French"] = "FRENCH";
65
+ /**
66
+ * @since 8.2.0
67
+ */
68
+ Language["German"] = "GERMAN";
69
+ /**
70
+ * @since 8.2.0
71
+ */
72
+ Language["Italian"] = "ITALIAN";
73
+ /**
74
+ * @since 8.2.0
75
+ */
76
+ Language["Japanese"] = "JAPANESE";
77
+ /**
78
+ * @since 8.2.0
79
+ */
80
+ Language["Korean"] = "KOREAN";
81
+ /**
82
+ * @since 8.2.0
83
+ */
84
+ Language["Spanish"] = "SPANISH";
85
+ })(exports.Language || (exports.Language = {}));
86
+
87
+ const GenAiProofreading = core.registerPlugin('GenAiProofreading', {
88
+ web: () => Promise.resolve().then(function () { return web; }).then(m => new m.GenAiProofreadingWeb()),
89
+ });
90
+
91
+ class GenAiProofreadingWeb extends core.WebPlugin {
92
+ async checkFeatureStatus(_options) {
93
+ throw this.createUnimplementedException();
94
+ }
95
+ async downloadFeature(_options) {
96
+ throw this.createUnimplementedException();
97
+ }
98
+ async proofread(_options) {
99
+ throw this.createUnimplementedException();
100
+ }
101
+ createUnimplementedException() {
102
+ return new core.CapacitorException('This plugin method is not implemented on this platform.', core.ExceptionCode.Unimplemented);
103
+ }
104
+ }
105
+
106
+ var web = /*#__PURE__*/Object.freeze({
107
+ __proto__: null,
108
+ GenAiProofreadingWeb: GenAiProofreadingWeb
109
+ });
110
+
111
+ exports.GenAiProofreading = GenAiProofreading;
112
+
113
+ return exports;
114
+
115
+ })({}, capacitorExports);
116
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * @since 8.2.0\n */\nexport var FeatureStatus;\n(function (FeatureStatus) {\n /**\n * The feature is available to use.\n *\n * @since 8.2.0\n */\n FeatureStatus[\"Available\"] = \"AVAILABLE\";\n /**\n * The feature can be downloaded using `downloadFeature(...)`.\n *\n * @since 8.2.0\n */\n FeatureStatus[\"Downloadable\"] = \"DOWNLOADABLE\";\n /**\n * The feature is currently being downloaded.\n *\n * @since 8.2.0\n */\n FeatureStatus[\"Downloading\"] = \"DOWNLOADING\";\n /**\n * The feature is not available on this device.\n *\n * @since 8.2.0\n */\n FeatureStatus[\"Unavailable\"] = \"UNAVAILABLE\";\n})(FeatureStatus || (FeatureStatus = {}));\n/**\n * @since 8.2.0\n */\nexport var InputType;\n(function (InputType) {\n /**\n * The input text was typed on a keyboard.\n *\n * @since 8.2.0\n */\n InputType[\"Keyboard\"] = \"KEYBOARD\";\n /**\n * The input text was produced by converting voice to text.\n *\n * @since 8.2.0\n */\n InputType[\"Voice\"] = \"VOICE\";\n})(InputType || (InputType = {}));\n/**\n * @since 8.2.0\n */\nexport var Language;\n(function (Language) {\n /**\n * @since 8.2.0\n */\n Language[\"English\"] = \"ENGLISH\";\n /**\n * @since 8.2.0\n */\n Language[\"French\"] = \"FRENCH\";\n /**\n * @since 8.2.0\n */\n Language[\"German\"] = \"GERMAN\";\n /**\n * @since 8.2.0\n */\n Language[\"Italian\"] = \"ITALIAN\";\n /**\n * @since 8.2.0\n */\n Language[\"Japanese\"] = \"JAPANESE\";\n /**\n * @since 8.2.0\n */\n Language[\"Korean\"] = \"KOREAN\";\n /**\n * @since 8.2.0\n */\n Language[\"Spanish\"] = \"SPANISH\";\n})(Language || (Language = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst GenAiProofreading = registerPlugin('GenAiProofreading', {\n web: () => import('./web').then(m => new m.GenAiProofreadingWeb()),\n});\nexport * from './definitions';\nexport { GenAiProofreading };\n//# sourceMappingURL=index.js.map","import { CapacitorException, ExceptionCode, WebPlugin } from '@capacitor/core';\nexport class GenAiProofreadingWeb extends WebPlugin {\n async checkFeatureStatus(_options) {\n throw this.createUnimplementedException();\n }\n async downloadFeature(_options) {\n throw this.createUnimplementedException();\n }\n async proofread(_options) {\n throw this.createUnimplementedException();\n }\n createUnimplementedException() {\n return new CapacitorException('This plugin method is not implemented on this platform.', ExceptionCode.Unimplemented);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["FeatureStatus","InputType","Language","registerPlugin","WebPlugin","CapacitorException","ExceptionCode"],"mappings":";;;IAAA;IACA;IACA;AACWA;IACX,CAAC,UAAU,aAAa,EAAE;IAC1B;IACA;IACA;IACA;IACA;IACA,IAAI,aAAa,CAAC,WAAW,CAAC,GAAG,WAAW;IAC5C;IACA;IACA;IACA;IACA;IACA,IAAI,aAAa,CAAC,cAAc,CAAC,GAAG,cAAc;IAClD;IACA;IACA;IACA;IACA;IACA,IAAI,aAAa,CAAC,aAAa,CAAC,GAAG,aAAa;IAChD;IACA;IACA;IACA;IACA;IACA,IAAI,aAAa,CAAC,aAAa,CAAC,GAAG,aAAa;IAChD,CAAC,EAAEA,qBAAa,KAAKA,qBAAa,GAAG,EAAE,CAAC,CAAC;IACzC;IACA;IACA;AACWC;IACX,CAAC,UAAU,SAAS,EAAE;IACtB;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,UAAU;IACtC;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,OAAO;IAChC,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;IACjC;IACA;IACA;AACWC;IACX,CAAC,UAAU,QAAQ,EAAE;IACrB;IACA;IACA;IACA,IAAI,QAAQ,CAAC,SAAS,CAAC,GAAG,SAAS;IACnC;IACA;IACA;IACA,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,QAAQ;IACjC;IACA;IACA;IACA,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,QAAQ;IACjC;IACA;IACA;IACA,IAAI,QAAQ,CAAC,SAAS,CAAC,GAAG,SAAS;IACnC;IACA;IACA;IACA,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,UAAU;IACrC;IACA;IACA;IACA,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,QAAQ;IACjC;IACA;IACA;IACA,IAAI,QAAQ,CAAC,SAAS,CAAC,GAAG,SAAS;IACnC,CAAC,EAAEA,gBAAQ,KAAKA,gBAAQ,GAAG,EAAE,CAAC,CAAC;;AChF1B,UAAC,iBAAiB,GAAGC,mBAAc,CAAC,mBAAmB,EAAE;IAC9D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;IACtE,CAAC;;ICFM,MAAM,oBAAoB,SAASC,cAAS,CAAC;IACpD,IAAI,MAAM,kBAAkB,CAAC,QAAQ,EAAE;IACvC,QAAQ,MAAM,IAAI,CAAC,4BAA4B,EAAE;IACjD,IAAI;IACJ,IAAI,MAAM,eAAe,CAAC,QAAQ,EAAE;IACpC,QAAQ,MAAM,IAAI,CAAC,4BAA4B,EAAE;IACjD,IAAI;IACJ,IAAI,MAAM,SAAS,CAAC,QAAQ,EAAE;IAC9B,QAAQ,MAAM,IAAI,CAAC,4BAA4B,EAAE;IACjD,IAAI;IACJ,IAAI,4BAA4B,GAAG;IACnC,QAAQ,OAAO,IAAIC,uBAAkB,CAAC,yDAAyD,EAAEC,kBAAa,CAAC,aAAa,CAAC;IAC7H,IAAI;IACJ;;;;;;;;;;;;;;;"}
@@ -0,0 +1,10 @@
1
+ #import <Foundation/Foundation.h>
2
+ #import <Capacitor/Capacitor.h>
3
+
4
+ // Define the plugin using the CAP_PLUGIN Macro, and
5
+ // each method the plugin supports using the CAP_PLUGIN_METHOD macro.
6
+ CAP_PLUGIN(GenAiProofreadingPlugin, "GenAiProofreading",
7
+ CAP_PLUGIN_METHOD(checkFeatureStatus, CAPPluginReturnPromise);
8
+ CAP_PLUGIN_METHOD(downloadFeature, CAPPluginReturnPromise);
9
+ CAP_PLUGIN_METHOD(proofread, CAPPluginReturnPromise);
10
+ )
@@ -0,0 +1,21 @@
1
+ import Foundation
2
+ import Capacitor
3
+
4
+ @objc(GenAiProofreadingPlugin)
5
+ public class GenAiProofreadingPlugin: CAPPlugin {
6
+ @objc func checkFeatureStatus(_ call: CAPPluginCall) {
7
+ rejectCallAsUnavailable(call)
8
+ }
9
+
10
+ @objc func downloadFeature(_ call: CAPPluginCall) {
11
+ rejectCallAsUnavailable(call)
12
+ }
13
+
14
+ @objc func proofread(_ call: CAPPluginCall) {
15
+ rejectCallAsUnavailable(call)
16
+ }
17
+
18
+ private func rejectCallAsUnavailable(_ call: CAPPluginCall) {
19
+ call.unavailable("This method is not available on this platform.")
20
+ }
21
+ }