@openfairygui/functions 0.1.0 → 0.1.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/dist/index.d.cts CHANGED
@@ -322,6 +322,49 @@ interface PublishCodeGenerationOptions {
322
322
  }
323
323
  declare function publishCodeGeneration(doc: Document, options: PublishCodeGenerationOptions): Promise<void>;
324
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
325
368
  //#region src/publish.d.ts
326
369
  interface PublishOptions {
327
370
  /**
@@ -419,4 +462,4 @@ declare function publish(options: PublishOptions): Transform;
419
462
  */
420
463
  declare function createTransform(name: string, fn: Transform): Transform;
421
464
  //#endregion
422
- export { AUTO_GENERATED_CODE_MARK, 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 RootProjectSettings, type ValidateOptions, type ValidationIssue, type ValidationResult, ValidationSeverity, atlas, createTransform, inspect, prune, publish, publishCodeGeneration, rename, resolvePublishOptions, validate };
465
+ export { AUTO_GENERATED_CODE_MARK, 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, atlas, createTransform, inspect, prune, publish, publishCodeGeneration, rename, resolvePublishOptions, restore, validate };
package/dist/index.d.ts CHANGED
@@ -322,6 +322,49 @@ interface PublishCodeGenerationOptions {
322
322
  }
323
323
  declare function publishCodeGeneration(doc: Document, options: PublishCodeGenerationOptions): Promise<void>;
324
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
325
368
  //#region src/publish.d.ts
326
369
  interface PublishOptions {
327
370
  /**
@@ -419,4 +462,4 @@ declare function publish(options: PublishOptions): Transform;
419
462
  */
420
463
  declare function createTransform(name: string, fn: Transform): Transform;
421
464
  //#endregion
422
- export { AUTO_GENERATED_CODE_MARK, 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 RootProjectSettings, type ValidateOptions, type ValidationIssue, type ValidationResult, ValidationSeverity, atlas, createTransform, inspect, prune, publish, publishCodeGeneration, rename, resolvePublishOptions, validate };
465
+ export { AUTO_GENERATED_CODE_MARK, 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, atlas, createTransform, inspect, prune, publish, publishCodeGeneration, rename, resolvePublishOptions, restore, validate };