@openfairygui/functions 0.2.0-alpha.0 → 0.2.0-alpha.11
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/README.md +4 -0
- package/dist/index.cjs +872 -282
- package/dist/index.d.cts +143 -79
- package/dist/index.d.ts +143 -79
- package/dist/index.js +869 -283
- package/dist/uam-transaction.cjs +79 -0
- package/dist/uam-transaction.d.cts +42 -0
- package/dist/uam-transaction.d.ts +42 -0
- package/dist/uam-transaction.js +78 -0
- package/package.json +66 -53
- package/src/atlas.ts +502 -146
- package/src/codegen.ts +104 -66
- package/src/index.ts +25 -1
- package/src/plugins/loader.ts +85 -0
- package/src/plugins/types.ts +47 -0
- package/src/publish.ts +499 -105
- package/src/restore.ts +12 -5
- package/src/shared-types.ts +1 -0
- package/src/uam-transaction.ts +69 -1
- package/src/utils.ts +28 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApplyUamTransactionAppDiagnostic, ApplyUamTransactionAppError, ApplyUamTransactionAppInput, ApplyUamTransactionAppResult, applyUamTransactionApp } from "./uam-transaction.cjs";
|
|
2
|
+
import { Component, Document, FileSystem, Package, ProjectSettings, PublishSettings, Transform } from "@openfairygui/core";
|
|
2
3
|
|
|
3
4
|
//#region src/inspect.d.ts
|
|
4
5
|
/**
|
|
@@ -167,6 +168,11 @@ declare function rename(options: RenameOptions): Transform;
|
|
|
167
168
|
//#endregion
|
|
168
169
|
//#region src/atlas.d.ts
|
|
169
170
|
interface AtlasOptions {
|
|
171
|
+
/**
|
|
172
|
+
* Limit atlas generation to specific package names.
|
|
173
|
+
* When omitted, all packages are processed.
|
|
174
|
+
*/
|
|
175
|
+
packages?: string[];
|
|
170
176
|
/**
|
|
171
177
|
* Sharp module instance, injected by the caller.
|
|
172
178
|
* Required for actual image compositing and trimImage.
|
|
@@ -313,65 +319,13 @@ type PublishFileSystem = Pick<FileSystem, 'join' | 'mkdir' | 'writeFileRaw'> & {
|
|
|
313
319
|
readFileRaw?: FileSystem['readFileRaw'];
|
|
314
320
|
};
|
|
315
321
|
//#endregion
|
|
316
|
-
//#region src/codegen.d.ts
|
|
317
|
-
declare const AUTO_GENERATED_CODE_MARK = "/** This is an automatically generated class by FairyGUI. Please do not modify it. **/";
|
|
318
|
-
interface PublishCodeGenerationOptions {
|
|
319
|
-
basePath?: string;
|
|
320
|
-
fs: PublishFileSystem;
|
|
321
|
-
packages: Package[];
|
|
322
|
-
}
|
|
323
|
-
declare function publishCodeGeneration(doc: Document, options: PublishCodeGenerationOptions): Promise<void>;
|
|
324
|
-
//#endregion
|
|
325
|
-
//#region src/restore.d.ts
|
|
326
|
-
interface RestoreImageCropInput {
|
|
327
|
-
sourcePath: string;
|
|
328
|
-
outputPath: string;
|
|
329
|
-
left: number;
|
|
330
|
-
top: number;
|
|
331
|
-
width: number;
|
|
332
|
-
height: number;
|
|
333
|
-
rotated: boolean;
|
|
334
|
-
offsetX: number;
|
|
335
|
-
offsetY: number;
|
|
336
|
-
expectedWidth: number;
|
|
337
|
-
expectedHeight: number;
|
|
338
|
-
}
|
|
339
|
-
type RestoreImageCropper = (input: RestoreImageCropInput) => Promise<void>;
|
|
340
|
-
type RestoreImageExtractInput = Omit<RestoreImageCropInput, 'outputPath'>;
|
|
341
|
-
type RestoreImageExtractor = (input: RestoreImageExtractInput) => Promise<Uint8Array>;
|
|
342
|
-
interface RestoreResult {
|
|
343
|
-
document: Document;
|
|
344
|
-
projectPath: string;
|
|
345
|
-
warnings: string[];
|
|
346
|
-
}
|
|
347
|
-
interface RestoreFileSystem extends Pick<FileSystem, 'readFile' | 'readFileRaw' | 'writeFile' | 'writeFileRaw' | 'mkdir' | 'exists' | 'join' | 'dirname'> {
|
|
348
|
-
readdir(path: string): Promise<string[]>;
|
|
349
|
-
isFile(path: string): Promise<boolean>;
|
|
350
|
-
resolvePath(path: string): string | Promise<string>;
|
|
351
|
-
rm?: (path: string, options?: {
|
|
352
|
-
recursive?: boolean;
|
|
353
|
-
force?: boolean;
|
|
354
|
-
}) => Promise<void>;
|
|
355
|
-
}
|
|
356
|
-
interface RestoreOptions {
|
|
357
|
-
inputDir: string;
|
|
358
|
-
output: string;
|
|
359
|
-
fs: RestoreFileSystem;
|
|
360
|
-
packages?: string[];
|
|
361
|
-
force?: boolean;
|
|
362
|
-
projectType?: number;
|
|
363
|
-
cropImage?: RestoreImageCropper;
|
|
364
|
-
extractImage?: RestoreImageExtractor;
|
|
365
|
-
}
|
|
366
|
-
declare function restore(options: RestoreOptions): Promise<RestoreResult>;
|
|
367
|
-
//#endregion
|
|
368
322
|
//#region src/publish.d.ts
|
|
369
323
|
interface PublishOptions {
|
|
370
324
|
/**
|
|
371
|
-
* Output directory for published files (.fui + atlas PNGs).
|
|
372
|
-
*
|
|
325
|
+
* Output directory override for published files (.fui + atlas PNGs).
|
|
326
|
+
* When omitted, publish uses package-level or project-level publish paths.
|
|
373
327
|
*/
|
|
374
|
-
output
|
|
328
|
+
output?: string;
|
|
375
329
|
/**
|
|
376
330
|
* Compress the binary data with zlib raw deflate. Default: false.
|
|
377
331
|
*/
|
|
@@ -456,29 +410,139 @@ declare function resolvePublishOptions(doc: Document, overrides?: ResolvePublish
|
|
|
456
410
|
*/
|
|
457
411
|
declare function publish(options: PublishOptions): Transform;
|
|
458
412
|
//#endregion
|
|
459
|
-
//#region src/
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
413
|
+
//#region src/plugins/types.d.ts
|
|
414
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
415
|
+
interface PluginManifest {
|
|
416
|
+
name: string;
|
|
417
|
+
displayName?: string;
|
|
418
|
+
description?: string;
|
|
419
|
+
version?: string;
|
|
420
|
+
author?: {
|
|
421
|
+
name?: string;
|
|
422
|
+
};
|
|
423
|
+
icon?: string;
|
|
424
|
+
main: string;
|
|
425
|
+
}
|
|
426
|
+
interface ICodeWriterConfig {
|
|
427
|
+
blockStart?: string;
|
|
428
|
+
blockEnd?: string;
|
|
429
|
+
blockFromNewLine?: boolean;
|
|
430
|
+
usingTabs?: boolean;
|
|
431
|
+
endOfLine?: string;
|
|
432
|
+
fileMark?: string;
|
|
433
|
+
}
|
|
434
|
+
interface CodeWriter {
|
|
435
|
+
writeMark(): void;
|
|
436
|
+
writeln(fmt?: string, ...args: any[]): CodeWriter;
|
|
437
|
+
startBlock(): CodeWriter;
|
|
438
|
+
endBlock(): CodeWriter;
|
|
439
|
+
incIndent(): CodeWriter;
|
|
440
|
+
decIndent(): CodeWriter;
|
|
441
|
+
reset(): void;
|
|
442
|
+
toString(): string;
|
|
443
|
+
save(filePath: string): void;
|
|
444
|
+
}
|
|
445
|
+
interface Plugin {
|
|
446
|
+
genCode?: (doc: Document, settings: Required<CliCodeGenerationSettings>, options: PublishCodeGenerationOptions) => MaybePromise<void>;
|
|
447
|
+
onPublishStart?: (doc: Document, options: PublishOptions) => MaybePromise<void>;
|
|
448
|
+
onPublishEnd?: (doc: Document, options: PublishOptions) => MaybePromise<void>;
|
|
449
|
+
}
|
|
450
|
+
type PluginModule = Plugin & {
|
|
451
|
+
default?: Plugin;
|
|
480
452
|
};
|
|
481
|
-
|
|
453
|
+
//#endregion
|
|
454
|
+
//#region src/plugins/loader.d.ts
|
|
455
|
+
interface LoadedPlugin {
|
|
456
|
+
name: string;
|
|
457
|
+
plugin: Plugin;
|
|
458
|
+
}
|
|
459
|
+
//#endregion
|
|
460
|
+
//#region src/codegen.d.ts
|
|
461
|
+
declare const AUTO_GENERATED_CODE_MARK = "/** This is an automatically generated class by FairyGUI. Please do not modify it. **/";
|
|
462
|
+
interface PublishCodeGenerationOptions {
|
|
463
|
+
basePath?: string;
|
|
464
|
+
fs: PublishFileSystem;
|
|
465
|
+
packages: Package[];
|
|
466
|
+
plugins?: LoadedPlugin[];
|
|
467
|
+
}
|
|
468
|
+
interface ResolvedPackageCodegenPlan {
|
|
469
|
+
outputDir: string;
|
|
470
|
+
packageFolderName: string;
|
|
471
|
+
packageNamespace: string;
|
|
472
|
+
binderClassName: string;
|
|
473
|
+
settings: CliCodeGenerationSettings;
|
|
474
|
+
}
|
|
475
|
+
interface CodegenMember {
|
|
476
|
+
index: number;
|
|
477
|
+
kind: 'child' | 'controller' | 'transition';
|
|
478
|
+
name: string;
|
|
479
|
+
originalName: string;
|
|
480
|
+
type: string;
|
|
481
|
+
ignored: boolean;
|
|
482
|
+
referencedComponent?: CodegenReferencedComponent;
|
|
483
|
+
}
|
|
484
|
+
interface CodegenReferencedComponent {
|
|
485
|
+
component: Component;
|
|
486
|
+
package: Package;
|
|
487
|
+
}
|
|
488
|
+
interface CodegenClass {
|
|
489
|
+
classId: string;
|
|
490
|
+
className: string;
|
|
491
|
+
encodedClassName: string;
|
|
492
|
+
componentType: string;
|
|
493
|
+
componentName: string;
|
|
494
|
+
packageName: string;
|
|
495
|
+
url: string;
|
|
496
|
+
members: CodegenMember[];
|
|
497
|
+
}
|
|
498
|
+
declare function publishCodeGeneration(doc: Document, options: PublishCodeGenerationOptions): Promise<void>;
|
|
499
|
+
declare function resolvePackageCodegenPlan(pkg: Package, settings: CliCodeGenerationSettings, options: PublishCodeGenerationOptions): ResolvedPackageCodegenPlan | null;
|
|
500
|
+
declare function buildCodegenClasses(doc: Document, pkg: Package, plan: ResolvedPackageCodegenPlan): CodegenClass[];
|
|
501
|
+
declare function encodeText(value: string): Uint8Array;
|
|
502
|
+
declare function decodeText(value: Uint8Array): string;
|
|
503
|
+
//#endregion
|
|
504
|
+
//#region src/restore.d.ts
|
|
505
|
+
interface RestoreImageCropInput {
|
|
506
|
+
sourcePath: string;
|
|
507
|
+
outputPath: string;
|
|
508
|
+
left: number;
|
|
509
|
+
top: number;
|
|
510
|
+
width: number;
|
|
511
|
+
height: number;
|
|
512
|
+
rotated: boolean;
|
|
513
|
+
offsetX: number;
|
|
514
|
+
offsetY: number;
|
|
515
|
+
expectedWidth: number;
|
|
516
|
+
expectedHeight: number;
|
|
517
|
+
}
|
|
518
|
+
type RestoreImageCropper = (input: RestoreImageCropInput) => Promise<void>;
|
|
519
|
+
type RestoreImageExtractInput = Omit<RestoreImageCropInput, 'outputPath'>;
|
|
520
|
+
type RestoreImageExtractor = (input: RestoreImageExtractInput) => Promise<Uint8Array>;
|
|
521
|
+
interface RestoreResult {
|
|
522
|
+
document: Document;
|
|
523
|
+
projectPath: string;
|
|
524
|
+
warnings: string[];
|
|
525
|
+
}
|
|
526
|
+
interface RestoreFileSystem extends Pick<FileSystem, 'readFile' | 'readFileRaw' | 'writeFile' | 'writeFileRaw' | 'mkdir' | 'exists' | 'join' | 'dirname'> {
|
|
527
|
+
readdir(path: string): Promise<string[]>;
|
|
528
|
+
isFile(path: string): Promise<boolean>;
|
|
529
|
+
resolvePath(path: string): string | Promise<string>;
|
|
530
|
+
rm?: (path: string, options?: {
|
|
531
|
+
recursive?: boolean;
|
|
532
|
+
force?: boolean;
|
|
533
|
+
}) => Promise<void>;
|
|
534
|
+
}
|
|
535
|
+
interface RestoreOptions {
|
|
536
|
+
inputDir: string;
|
|
537
|
+
output: string;
|
|
538
|
+
fs: RestoreFileSystem;
|
|
539
|
+
packages?: string[];
|
|
540
|
+
force?: boolean;
|
|
541
|
+
projectType?: number;
|
|
542
|
+
cropImage?: RestoreImageCropper;
|
|
543
|
+
extractImage?: RestoreImageExtractor;
|
|
544
|
+
}
|
|
545
|
+
declare function restore(options: RestoreOptions): Promise<RestoreResult>;
|
|
482
546
|
//#endregion
|
|
483
547
|
//#region src/utils.d.ts
|
|
484
548
|
/**
|
|
@@ -486,4 +550,4 @@ declare function applyUamTransactionApp(input: ApplyUamTransactionAppInput): App
|
|
|
486
550
|
*/
|
|
487
551
|
declare function createTransform(name: string, fn: Transform): Transform;
|
|
488
552
|
//#endregion
|
|
489
|
-
export { AUTO_GENERATED_CODE_MARK, type ApplyUamTransactionAppError, type ApplyUamTransactionAppInput, type ApplyUamTransactionAppResult, type AtlasOptions, type CliAtlasSettings, type CliPublishSettings, type ExtrasMap, type HasOptionalFont, type HasOptionalSrc, type HasOptionalUrl, type InspectCategoryReport, type InspectReport, type PruneOptions, type PublishCodeGenerationOptions, type PublishDependency, type PublishFileSystem, type PublishOptions, type RenameOptions, type ResolvePublishOptionsOverrides, type ResolvedPublishAtlasOptions, type ResolvedPublishOptions, type RestoreFileSystem, type RestoreImageCropInput, type RestoreImageCropper, type RestoreImageExtractInput, type RestoreImageExtractor, type RestoreOptions, type RestoreResult, type RootProjectSettings, type ValidateOptions, type ValidationIssue, type ValidationResult, ValidationSeverity, applyUamTransactionApp, atlas, createTransform, inspect, prune, publish, publishCodeGeneration, rename, resolvePublishOptions, restore, validate };
|
|
553
|
+
export { AUTO_GENERATED_CODE_MARK, type ApplyUamTransactionAppDiagnostic, type ApplyUamTransactionAppError, type ApplyUamTransactionAppInput, type ApplyUamTransactionAppResult, type AtlasOptions, type CliAtlasSettings, type CliCodeGenerationSettings, type CliPublishSettings, type CodeWriter, type CodegenClass, type CodegenMember, type CodegenReferencedComponent, type ExtrasMap, type HasOptionalFont, type HasOptionalSrc, type HasOptionalUrl, type ICodeWriterConfig, type InspectCategoryReport, type InspectReport, type MaybePromise, type Plugin, type PluginManifest, type PluginModule, type PruneOptions, type PublishCodeGenerationOptions, type PublishDependency, type PublishFileSystem, type PublishOptions, type RenameOptions, type ResolvePublishOptionsOverrides, type ResolvedPackageCodegenPlan, type ResolvedPublishAtlasOptions, type ResolvedPublishOptions, type RestoreFileSystem, type RestoreImageCropInput, type RestoreImageCropper, type RestoreImageExtractInput, type RestoreImageExtractor, type RestoreOptions, type RestoreResult, type RootProjectSettings, type ValidateOptions, type ValidationIssue, type ValidationResult, ValidationSeverity, applyUamTransactionApp, atlas, buildCodegenClasses, createTransform, decodeText, encodeText, inspect, prune, publish, publishCodeGeneration, rename, resolvePackageCodegenPlan, resolvePublishOptions, restore, validate };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApplyUamTransactionAppDiagnostic, ApplyUamTransactionAppError, ApplyUamTransactionAppInput, ApplyUamTransactionAppResult, applyUamTransactionApp } from "./uam-transaction.js";
|
|
2
|
+
import { Component, Document, FileSystem, Package, ProjectSettings, PublishSettings, Transform } from "@openfairygui/core";
|
|
2
3
|
|
|
3
4
|
//#region src/inspect.d.ts
|
|
4
5
|
/**
|
|
@@ -167,6 +168,11 @@ declare function rename(options: RenameOptions): Transform;
|
|
|
167
168
|
//#endregion
|
|
168
169
|
//#region src/atlas.d.ts
|
|
169
170
|
interface AtlasOptions {
|
|
171
|
+
/**
|
|
172
|
+
* Limit atlas generation to specific package names.
|
|
173
|
+
* When omitted, all packages are processed.
|
|
174
|
+
*/
|
|
175
|
+
packages?: string[];
|
|
170
176
|
/**
|
|
171
177
|
* Sharp module instance, injected by the caller.
|
|
172
178
|
* Required for actual image compositing and trimImage.
|
|
@@ -313,65 +319,13 @@ type PublishFileSystem = Pick<FileSystem, 'join' | 'mkdir' | 'writeFileRaw'> & {
|
|
|
313
319
|
readFileRaw?: FileSystem['readFileRaw'];
|
|
314
320
|
};
|
|
315
321
|
//#endregion
|
|
316
|
-
//#region src/codegen.d.ts
|
|
317
|
-
declare const AUTO_GENERATED_CODE_MARK = "/** This is an automatically generated class by FairyGUI. Please do not modify it. **/";
|
|
318
|
-
interface PublishCodeGenerationOptions {
|
|
319
|
-
basePath?: string;
|
|
320
|
-
fs: PublishFileSystem;
|
|
321
|
-
packages: Package[];
|
|
322
|
-
}
|
|
323
|
-
declare function publishCodeGeneration(doc: Document, options: PublishCodeGenerationOptions): Promise<void>;
|
|
324
|
-
//#endregion
|
|
325
|
-
//#region src/restore.d.ts
|
|
326
|
-
interface RestoreImageCropInput {
|
|
327
|
-
sourcePath: string;
|
|
328
|
-
outputPath: string;
|
|
329
|
-
left: number;
|
|
330
|
-
top: number;
|
|
331
|
-
width: number;
|
|
332
|
-
height: number;
|
|
333
|
-
rotated: boolean;
|
|
334
|
-
offsetX: number;
|
|
335
|
-
offsetY: number;
|
|
336
|
-
expectedWidth: number;
|
|
337
|
-
expectedHeight: number;
|
|
338
|
-
}
|
|
339
|
-
type RestoreImageCropper = (input: RestoreImageCropInput) => Promise<void>;
|
|
340
|
-
type RestoreImageExtractInput = Omit<RestoreImageCropInput, 'outputPath'>;
|
|
341
|
-
type RestoreImageExtractor = (input: RestoreImageExtractInput) => Promise<Uint8Array>;
|
|
342
|
-
interface RestoreResult {
|
|
343
|
-
document: Document;
|
|
344
|
-
projectPath: string;
|
|
345
|
-
warnings: string[];
|
|
346
|
-
}
|
|
347
|
-
interface RestoreFileSystem extends Pick<FileSystem, 'readFile' | 'readFileRaw' | 'writeFile' | 'writeFileRaw' | 'mkdir' | 'exists' | 'join' | 'dirname'> {
|
|
348
|
-
readdir(path: string): Promise<string[]>;
|
|
349
|
-
isFile(path: string): Promise<boolean>;
|
|
350
|
-
resolvePath(path: string): string | Promise<string>;
|
|
351
|
-
rm?: (path: string, options?: {
|
|
352
|
-
recursive?: boolean;
|
|
353
|
-
force?: boolean;
|
|
354
|
-
}) => Promise<void>;
|
|
355
|
-
}
|
|
356
|
-
interface RestoreOptions {
|
|
357
|
-
inputDir: string;
|
|
358
|
-
output: string;
|
|
359
|
-
fs: RestoreFileSystem;
|
|
360
|
-
packages?: string[];
|
|
361
|
-
force?: boolean;
|
|
362
|
-
projectType?: number;
|
|
363
|
-
cropImage?: RestoreImageCropper;
|
|
364
|
-
extractImage?: RestoreImageExtractor;
|
|
365
|
-
}
|
|
366
|
-
declare function restore(options: RestoreOptions): Promise<RestoreResult>;
|
|
367
|
-
//#endregion
|
|
368
322
|
//#region src/publish.d.ts
|
|
369
323
|
interface PublishOptions {
|
|
370
324
|
/**
|
|
371
|
-
* Output directory for published files (.fui + atlas PNGs).
|
|
372
|
-
*
|
|
325
|
+
* Output directory override for published files (.fui + atlas PNGs).
|
|
326
|
+
* When omitted, publish uses package-level or project-level publish paths.
|
|
373
327
|
*/
|
|
374
|
-
output
|
|
328
|
+
output?: string;
|
|
375
329
|
/**
|
|
376
330
|
* Compress the binary data with zlib raw deflate. Default: false.
|
|
377
331
|
*/
|
|
@@ -456,29 +410,139 @@ declare function resolvePublishOptions(doc: Document, overrides?: ResolvePublish
|
|
|
456
410
|
*/
|
|
457
411
|
declare function publish(options: PublishOptions): Transform;
|
|
458
412
|
//#endregion
|
|
459
|
-
//#region src/
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
413
|
+
//#region src/plugins/types.d.ts
|
|
414
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
415
|
+
interface PluginManifest {
|
|
416
|
+
name: string;
|
|
417
|
+
displayName?: string;
|
|
418
|
+
description?: string;
|
|
419
|
+
version?: string;
|
|
420
|
+
author?: {
|
|
421
|
+
name?: string;
|
|
422
|
+
};
|
|
423
|
+
icon?: string;
|
|
424
|
+
main: string;
|
|
425
|
+
}
|
|
426
|
+
interface ICodeWriterConfig {
|
|
427
|
+
blockStart?: string;
|
|
428
|
+
blockEnd?: string;
|
|
429
|
+
blockFromNewLine?: boolean;
|
|
430
|
+
usingTabs?: boolean;
|
|
431
|
+
endOfLine?: string;
|
|
432
|
+
fileMark?: string;
|
|
433
|
+
}
|
|
434
|
+
interface CodeWriter {
|
|
435
|
+
writeMark(): void;
|
|
436
|
+
writeln(fmt?: string, ...args: any[]): CodeWriter;
|
|
437
|
+
startBlock(): CodeWriter;
|
|
438
|
+
endBlock(): CodeWriter;
|
|
439
|
+
incIndent(): CodeWriter;
|
|
440
|
+
decIndent(): CodeWriter;
|
|
441
|
+
reset(): void;
|
|
442
|
+
toString(): string;
|
|
443
|
+
save(filePath: string): void;
|
|
444
|
+
}
|
|
445
|
+
interface Plugin {
|
|
446
|
+
genCode?: (doc: Document, settings: Required<CliCodeGenerationSettings>, options: PublishCodeGenerationOptions) => MaybePromise<void>;
|
|
447
|
+
onPublishStart?: (doc: Document, options: PublishOptions) => MaybePromise<void>;
|
|
448
|
+
onPublishEnd?: (doc: Document, options: PublishOptions) => MaybePromise<void>;
|
|
449
|
+
}
|
|
450
|
+
type PluginModule = Plugin & {
|
|
451
|
+
default?: Plugin;
|
|
480
452
|
};
|
|
481
|
-
|
|
453
|
+
//#endregion
|
|
454
|
+
//#region src/plugins/loader.d.ts
|
|
455
|
+
interface LoadedPlugin {
|
|
456
|
+
name: string;
|
|
457
|
+
plugin: Plugin;
|
|
458
|
+
}
|
|
459
|
+
//#endregion
|
|
460
|
+
//#region src/codegen.d.ts
|
|
461
|
+
declare const AUTO_GENERATED_CODE_MARK = "/** This is an automatically generated class by FairyGUI. Please do not modify it. **/";
|
|
462
|
+
interface PublishCodeGenerationOptions {
|
|
463
|
+
basePath?: string;
|
|
464
|
+
fs: PublishFileSystem;
|
|
465
|
+
packages: Package[];
|
|
466
|
+
plugins?: LoadedPlugin[];
|
|
467
|
+
}
|
|
468
|
+
interface ResolvedPackageCodegenPlan {
|
|
469
|
+
outputDir: string;
|
|
470
|
+
packageFolderName: string;
|
|
471
|
+
packageNamespace: string;
|
|
472
|
+
binderClassName: string;
|
|
473
|
+
settings: CliCodeGenerationSettings;
|
|
474
|
+
}
|
|
475
|
+
interface CodegenMember {
|
|
476
|
+
index: number;
|
|
477
|
+
kind: 'child' | 'controller' | 'transition';
|
|
478
|
+
name: string;
|
|
479
|
+
originalName: string;
|
|
480
|
+
type: string;
|
|
481
|
+
ignored: boolean;
|
|
482
|
+
referencedComponent?: CodegenReferencedComponent;
|
|
483
|
+
}
|
|
484
|
+
interface CodegenReferencedComponent {
|
|
485
|
+
component: Component;
|
|
486
|
+
package: Package;
|
|
487
|
+
}
|
|
488
|
+
interface CodegenClass {
|
|
489
|
+
classId: string;
|
|
490
|
+
className: string;
|
|
491
|
+
encodedClassName: string;
|
|
492
|
+
componentType: string;
|
|
493
|
+
componentName: string;
|
|
494
|
+
packageName: string;
|
|
495
|
+
url: string;
|
|
496
|
+
members: CodegenMember[];
|
|
497
|
+
}
|
|
498
|
+
declare function publishCodeGeneration(doc: Document, options: PublishCodeGenerationOptions): Promise<void>;
|
|
499
|
+
declare function resolvePackageCodegenPlan(pkg: Package, settings: CliCodeGenerationSettings, options: PublishCodeGenerationOptions): ResolvedPackageCodegenPlan | null;
|
|
500
|
+
declare function buildCodegenClasses(doc: Document, pkg: Package, plan: ResolvedPackageCodegenPlan): CodegenClass[];
|
|
501
|
+
declare function encodeText(value: string): Uint8Array;
|
|
502
|
+
declare function decodeText(value: Uint8Array): string;
|
|
503
|
+
//#endregion
|
|
504
|
+
//#region src/restore.d.ts
|
|
505
|
+
interface RestoreImageCropInput {
|
|
506
|
+
sourcePath: string;
|
|
507
|
+
outputPath: string;
|
|
508
|
+
left: number;
|
|
509
|
+
top: number;
|
|
510
|
+
width: number;
|
|
511
|
+
height: number;
|
|
512
|
+
rotated: boolean;
|
|
513
|
+
offsetX: number;
|
|
514
|
+
offsetY: number;
|
|
515
|
+
expectedWidth: number;
|
|
516
|
+
expectedHeight: number;
|
|
517
|
+
}
|
|
518
|
+
type RestoreImageCropper = (input: RestoreImageCropInput) => Promise<void>;
|
|
519
|
+
type RestoreImageExtractInput = Omit<RestoreImageCropInput, 'outputPath'>;
|
|
520
|
+
type RestoreImageExtractor = (input: RestoreImageExtractInput) => Promise<Uint8Array>;
|
|
521
|
+
interface RestoreResult {
|
|
522
|
+
document: Document;
|
|
523
|
+
projectPath: string;
|
|
524
|
+
warnings: string[];
|
|
525
|
+
}
|
|
526
|
+
interface RestoreFileSystem extends Pick<FileSystem, 'readFile' | 'readFileRaw' | 'writeFile' | 'writeFileRaw' | 'mkdir' | 'exists' | 'join' | 'dirname'> {
|
|
527
|
+
readdir(path: string): Promise<string[]>;
|
|
528
|
+
isFile(path: string): Promise<boolean>;
|
|
529
|
+
resolvePath(path: string): string | Promise<string>;
|
|
530
|
+
rm?: (path: string, options?: {
|
|
531
|
+
recursive?: boolean;
|
|
532
|
+
force?: boolean;
|
|
533
|
+
}) => Promise<void>;
|
|
534
|
+
}
|
|
535
|
+
interface RestoreOptions {
|
|
536
|
+
inputDir: string;
|
|
537
|
+
output: string;
|
|
538
|
+
fs: RestoreFileSystem;
|
|
539
|
+
packages?: string[];
|
|
540
|
+
force?: boolean;
|
|
541
|
+
projectType?: number;
|
|
542
|
+
cropImage?: RestoreImageCropper;
|
|
543
|
+
extractImage?: RestoreImageExtractor;
|
|
544
|
+
}
|
|
545
|
+
declare function restore(options: RestoreOptions): Promise<RestoreResult>;
|
|
482
546
|
//#endregion
|
|
483
547
|
//#region src/utils.d.ts
|
|
484
548
|
/**
|
|
@@ -486,4 +550,4 @@ declare function applyUamTransactionApp(input: ApplyUamTransactionAppInput): App
|
|
|
486
550
|
*/
|
|
487
551
|
declare function createTransform(name: string, fn: Transform): Transform;
|
|
488
552
|
//#endregion
|
|
489
|
-
export { AUTO_GENERATED_CODE_MARK, type ApplyUamTransactionAppError, type ApplyUamTransactionAppInput, type ApplyUamTransactionAppResult, type AtlasOptions, type CliAtlasSettings, type CliPublishSettings, type ExtrasMap, type HasOptionalFont, type HasOptionalSrc, type HasOptionalUrl, type InspectCategoryReport, type InspectReport, type PruneOptions, type PublishCodeGenerationOptions, type PublishDependency, type PublishFileSystem, type PublishOptions, type RenameOptions, type ResolvePublishOptionsOverrides, type ResolvedPublishAtlasOptions, type ResolvedPublishOptions, type RestoreFileSystem, type RestoreImageCropInput, type RestoreImageCropper, type RestoreImageExtractInput, type RestoreImageExtractor, type RestoreOptions, type RestoreResult, type RootProjectSettings, type ValidateOptions, type ValidationIssue, type ValidationResult, ValidationSeverity, applyUamTransactionApp, atlas, createTransform, inspect, prune, publish, publishCodeGeneration, rename, resolvePublishOptions, restore, validate };
|
|
553
|
+
export { AUTO_GENERATED_CODE_MARK, type ApplyUamTransactionAppDiagnostic, type ApplyUamTransactionAppError, type ApplyUamTransactionAppInput, type ApplyUamTransactionAppResult, type AtlasOptions, type CliAtlasSettings, type CliCodeGenerationSettings, type CliPublishSettings, type CodeWriter, type CodegenClass, type CodegenMember, type CodegenReferencedComponent, type ExtrasMap, type HasOptionalFont, type HasOptionalSrc, type HasOptionalUrl, type ICodeWriterConfig, type InspectCategoryReport, type InspectReport, type MaybePromise, type Plugin, type PluginManifest, type PluginModule, type PruneOptions, type PublishCodeGenerationOptions, type PublishDependency, type PublishFileSystem, type PublishOptions, type RenameOptions, type ResolvePublishOptionsOverrides, type ResolvedPackageCodegenPlan, type ResolvedPublishAtlasOptions, type ResolvedPublishOptions, type RestoreFileSystem, type RestoreImageCropInput, type RestoreImageCropper, type RestoreImageExtractInput, type RestoreImageExtractor, type RestoreOptions, type RestoreResult, type RootProjectSettings, type ValidateOptions, type ValidationIssue, type ValidationResult, ValidationSeverity, applyUamTransactionApp, atlas, buildCodegenClasses, createTransform, decodeText, encodeText, inspect, prune, publish, publishCodeGeneration, rename, resolvePackageCodegenPlan, resolvePublishOptions, restore, validate };
|