@cesdk/node 1.77.0-nightly.20260612 → 1.77.0-rc.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/assets/core/{cesdk-v1.77.0-nightly.20260612-B7VVEG2R.wasm → cesdk-v1.77.0-rc.1-5RT2AJRG.wasm} +0 -0
- package/index.d.mts +260 -0
- package/index.d.ts +260 -0
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
- /package/assets/core/{cesdk-v1.77.0-nightly.20260612-MLEZSZ4D.data → cesdk-v1.77.0-rc.1-MLEZSZ4D.data} +0 -0
|
Binary file
|
package/index.d.mts
CHANGED
|
@@ -1022,6 +1022,8 @@ export declare interface AssetPayload {
|
|
|
1022
1022
|
typeface?: Typeface;
|
|
1023
1023
|
transformPreset?: AssetTransformPreset;
|
|
1024
1024
|
properties?: AssetProperty[];
|
|
1025
|
+
/** A declarative style preset the engine applies to text/caption blocks. */
|
|
1026
|
+
stylePreset?: AssetStylePreset;
|
|
1025
1027
|
}
|
|
1026
1028
|
|
|
1027
1029
|
/**
|
|
@@ -1311,6 +1313,166 @@ export declare interface AssetStringProperty {
|
|
|
1311
1313
|
defaultValue: string;
|
|
1312
1314
|
}
|
|
1313
1315
|
|
|
1316
|
+
/**
|
|
1317
|
+
* A declarative style preset the engine applies to text and caption blocks. The engine parses and
|
|
1318
|
+
* applies it identically on every platform. Lives in {@link AssetPayload.stylePreset}.
|
|
1319
|
+
*
|
|
1320
|
+
* Most of the look is in {@link AssetStylePreset.properties}; the other fields cover the font,
|
|
1321
|
+
* size-relative scaling and animations.
|
|
1322
|
+
* @public
|
|
1323
|
+
*/
|
|
1324
|
+
export declare interface AssetStylePreset {
|
|
1325
|
+
/**
|
|
1326
|
+
* The block type this preset is for. Used as the type to create when the preset is applied with no
|
|
1327
|
+
* target block, and as the apply filter (it only restyles a block of this type). Omitted applies to any
|
|
1328
|
+
* block. Style presets target text and caption blocks; the value is the longhand id, which the engine
|
|
1329
|
+
* matches against the block's `getType()`.
|
|
1330
|
+
*/
|
|
1331
|
+
blockType?: '//ly.img.ubq/text' | '//ly.img.ubq/caption';
|
|
1332
|
+
/**
|
|
1333
|
+
* How the preset combines with the block's current look. `'replace'` (the default) also clears the
|
|
1334
|
+
* decorations and animations the preset omits, so switching presets never stacks; `'merge'` layers
|
|
1335
|
+
* the preset on top, keeping everything it does not set. Either way the block's text content is never
|
|
1336
|
+
* touched, and its size only changes when the preset asks for it (`fontSize.resizeExistingOnApply`,
|
|
1337
|
+
* or a `text/path` baseline adopting its bounding box).
|
|
1338
|
+
*/
|
|
1339
|
+
mode?: 'replace' | 'merge';
|
|
1340
|
+
/**
|
|
1341
|
+
* Font to apply. The engine resolves `family` against the registered typefaces and matches
|
|
1342
|
+
* `weight`/`style`. Ignored when the family is empty or not registered.
|
|
1343
|
+
*/
|
|
1344
|
+
typeface?: {
|
|
1345
|
+
family: string;
|
|
1346
|
+
weight?: FontWeight;
|
|
1347
|
+
style?: FontStyle;
|
|
1348
|
+
};
|
|
1349
|
+
/**
|
|
1350
|
+
* Scene-relative font size. `scale` is a unitless multiplier on the scene's base font size (1 = the
|
|
1351
|
+
* base size), sizing a block created from the preset. With `resizeExistingOnApply: true` the same size
|
|
1352
|
+
* also resizes an existing block on apply. For an absolute size, set `properties['text/fontSize']`
|
|
1353
|
+
* instead (it takes precedence).
|
|
1354
|
+
*/
|
|
1355
|
+
fontSize?: {
|
|
1356
|
+
scale: number;
|
|
1357
|
+
resizeExistingOnApply?: boolean;
|
|
1358
|
+
};
|
|
1359
|
+
/**
|
|
1360
|
+
* Lengths that scale with the block's font size. Each entry sets its `property` to `ratio × fontSize`
|
|
1361
|
+
* — e.g. `{ property: 'stroke/width', ratio: 0.012 }` makes the stroke width `0.012 × fontSize`. Keeps
|
|
1362
|
+
* a preset's stroke width, drop-shadow offset/blur, … proportional at any size.
|
|
1363
|
+
*/
|
|
1364
|
+
scaleWithFontSize?: Array<{
|
|
1365
|
+
property: AssetStylePresetScalableProperty;
|
|
1366
|
+
ratio: number;
|
|
1367
|
+
}>;
|
|
1368
|
+
/**
|
|
1369
|
+
* The bulk of the look: typography plus the `fill/*`, `stroke/*`, `dropShadow/*` and
|
|
1370
|
+
* `backgroundColor/*` decorations with their `…/enabled` toggles. Known paths are value-checked and
|
|
1371
|
+
* autocomplete. See {@link AssetStylePresetProperties}.
|
|
1372
|
+
*/
|
|
1373
|
+
properties?: AssetStylePresetProperties;
|
|
1374
|
+
/** Entrance animation. */
|
|
1375
|
+
inAnimation?: AssetStylePresetAnimation;
|
|
1376
|
+
/** Exit animation. */
|
|
1377
|
+
outAnimation?: AssetStylePresetAnimation;
|
|
1378
|
+
/** Looping animation. */
|
|
1379
|
+
loopAnimation?: AssetStylePresetAnimation;
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
/**
|
|
1383
|
+
* An animation slot of an {@link AssetStylePreset} (`inAnimation`, `outAnimation` or `loopAnimation`).
|
|
1384
|
+
* @public
|
|
1385
|
+
*/
|
|
1386
|
+
export declare interface AssetStylePresetAnimation {
|
|
1387
|
+
/** The animation block type to apply, e.g. `'//ly.img.ubq/animation/slide'`. */
|
|
1388
|
+
type: AnimationTypeLonghand;
|
|
1389
|
+
/** Configures the animation as a map of its property paths to values. */
|
|
1390
|
+
properties?: AssetStylePresetAnimationProperties;
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
/**
|
|
1394
|
+
* The parameters of an {@link AssetStylePresetAnimation}: a map of the animation's property paths to
|
|
1395
|
+
* values. The animation's `animation/*` properties (e.g. `animation/slide/fade`,
|
|
1396
|
+
* `animation/grow/scaleFactor`) are value-checked and autocomplete, as are the animation controls
|
|
1397
|
+
* (`playback/duration`, `animationEasing`, `textWritingStyle`, `textWritingOverlap`); any other
|
|
1398
|
+
* property path is still accepted. These are animation paths, distinct from the block-property paths
|
|
1399
|
+
* in {@link AssetStylePresetProperties}.
|
|
1400
|
+
* @public
|
|
1401
|
+
*/
|
|
1402
|
+
export declare type AssetStylePresetAnimationProperties = {
|
|
1403
|
+
[K in Extract<BoolPropertyName, `animation/${string}`>]?: boolean;
|
|
1404
|
+
} & {
|
|
1405
|
+
[K in Extract<EnumPropertyName, `animation/${string}`>]?: string;
|
|
1406
|
+
} & {
|
|
1407
|
+
[K in Extract<FloatPropertyName, `animation/${string}`>]?: number;
|
|
1408
|
+
} & {
|
|
1409
|
+
[K in Extract<ColorPropertyName, `animation/${string}`>]?: RGBColor | RGBAColor;
|
|
1410
|
+
} & {
|
|
1411
|
+
/** Animation controls applied outside the `animation/*` properties. */
|
|
1412
|
+
'playback/duration'?: number;
|
|
1413
|
+
animationEasing?: string;
|
|
1414
|
+
textWritingStyle?: string;
|
|
1415
|
+
textWritingOverlap?: number;
|
|
1416
|
+
} & {
|
|
1417
|
+
[path: string]: AssetStylePresetPropertyValue;
|
|
1418
|
+
};
|
|
1419
|
+
|
|
1420
|
+
/**
|
|
1421
|
+
* The look of an {@link AssetStylePreset}: a map of property paths to values. Known paths are
|
|
1422
|
+
* value-checked and autocomplete (e.g. `stroke/enabled` must be a boolean, `stroke/width` a number,
|
|
1423
|
+
* `fill/solid/color` a color); any other property path is still accepted with the broader
|
|
1424
|
+
* {@link AssetStylePresetPropertyValue}. Keys without a `/` are namespaced to the block (`text/` or
|
|
1425
|
+
* `caption/`); keys with a `/` are used verbatim.
|
|
1426
|
+
* @public
|
|
1427
|
+
*/
|
|
1428
|
+
export declare type AssetStylePresetProperties = {
|
|
1429
|
+
[K in BoolPropertyName as string extends K ? never : K]?: boolean;
|
|
1430
|
+
} & {
|
|
1431
|
+
[K in IntPropertyName as string extends K ? never : K]?: number;
|
|
1432
|
+
} & {
|
|
1433
|
+
[K in FloatPropertyName as string extends K ? never : K]?: number;
|
|
1434
|
+
} & {
|
|
1435
|
+
[K in DoublePropertyName as string extends K ? never : K]?: number;
|
|
1436
|
+
} & {
|
|
1437
|
+
[K in StringPropertyName as string extends K ? never : K]?: string;
|
|
1438
|
+
} & {
|
|
1439
|
+
[K in EnumPropertyName as string extends K ? never : K]?: string;
|
|
1440
|
+
} & {
|
|
1441
|
+
[K in ColorPropertyName as string extends K ? never : K]?: RGBColor | RGBAColor;
|
|
1442
|
+
} & {
|
|
1443
|
+
/**
|
|
1444
|
+
* The text-on-path baseline (see `setTextOnPath`): a single-subpath SVG path string in the block's
|
|
1445
|
+
* local coordinate space wraps the block's text on the path and resizes the block to the path's
|
|
1446
|
+
* bounding box; an explicit `null` clears the path and restores normal layout. This is a virtual
|
|
1447
|
+
* preset property — the baseline path is not a reflected block property, so the engine routes it
|
|
1448
|
+
* through `setTextOnPath`, inheriting its validation. Pair it with `text/pathOffset` and
|
|
1449
|
+
* `text/pathFlipped` (plain reflected properties) to fully define the path state. Which curve is
|
|
1450
|
+
* applied is identified by the path value itself — compare `getTextOnPath` against an entry's
|
|
1451
|
+
* `text/path`.
|
|
1452
|
+
*/
|
|
1453
|
+
'text/path'?: string | null;
|
|
1454
|
+
} & {
|
|
1455
|
+
[path: string]: AssetStylePresetPropertyValue;
|
|
1456
|
+
};
|
|
1457
|
+
|
|
1458
|
+
/**
|
|
1459
|
+
* A value a style preset can set on a property: a boolean, number, string (including enum values) or
|
|
1460
|
+
* an RGB(A) color. Colors must be RGB(A) (`{ r, g, b, a? }`); CMYK and spot colors are not supported in
|
|
1461
|
+
* presets. Structs and source sets cannot be set from a preset. A `null` value is ignored for regular
|
|
1462
|
+
* properties; for the virtual `text/path` property it clears the baseline path.
|
|
1463
|
+
* @public
|
|
1464
|
+
*/
|
|
1465
|
+
export declare type AssetStylePresetPropertyValue = boolean | number | string | RGBColor | RGBAColor | null;
|
|
1466
|
+
|
|
1467
|
+
/**
|
|
1468
|
+
* A length property a style preset may scale with the block's font size (see
|
|
1469
|
+
* {@link AssetStylePreset.scaleWithFontSize}). Restricted to the decoration lengths for which scaling is
|
|
1470
|
+
* meaningful — stroke width, drop-shadow offset/blur and the caption background corner radius — not
|
|
1471
|
+
* arbitrary numeric properties like `rotation` or `opacity`.
|
|
1472
|
+
* @public
|
|
1473
|
+
*/
|
|
1474
|
+
export declare type AssetStylePresetScalableProperty = 'stroke/width' | 'dropShadow/offset/x' | 'dropShadow/offset/y' | 'dropShadow/blurRadius/x' | 'dropShadow/blurRadius/y' | 'backgroundColor/cornerRadius';
|
|
1475
|
+
|
|
1314
1476
|
/**
|
|
1315
1477
|
* Transform preset payload
|
|
1316
1478
|
* @public
|
|
@@ -6684,6 +6846,12 @@ declare class CreativeEngine {
|
|
|
6684
6846
|
event: EventAPI;
|
|
6685
6847
|
scene: SceneAPI;
|
|
6686
6848
|
variable: VariableAPI;
|
|
6849
|
+
/**
|
|
6850
|
+
* Register, run, and discover named, overridable actions. On headless Node the registry
|
|
6851
|
+
* starts with only the engine-default `ly.img.*` actions (no host UI), but the API is
|
|
6852
|
+
* identical to the browser engine.
|
|
6853
|
+
*/
|
|
6854
|
+
actions: EngineActions;
|
|
6687
6855
|
version: string;
|
|
6688
6856
|
|
|
6689
6857
|
/**
|
|
@@ -8099,6 +8267,97 @@ export declare type EffectTypeLonghand = `//ly.img.ubq/effect/${EffectTypeShorth
|
|
|
8099
8267
|
/** @public */
|
|
8100
8268
|
export declare type EffectTypeShorthand = (typeof EFFECT_TYPES)[number];
|
|
8101
8269
|
|
|
8270
|
+
/** @public Known action ids from {@link EngineActionsRegistry}. */
|
|
8271
|
+
export declare type EngineActionId = keyof EngineActionsRegistry & string;
|
|
8272
|
+
|
|
8273
|
+
/** @public Info about a registered action, from {@link EngineActions.list}. */
|
|
8274
|
+
export declare interface EngineActionInfo {
|
|
8275
|
+
/** The action id, e.g. `nudge`. */
|
|
8276
|
+
id: string;
|
|
8277
|
+
/** Whether the action currently says it can run. */
|
|
8278
|
+
enabled: boolean;
|
|
8279
|
+
/** Optional JSON description of the arguments it accepts. */
|
|
8280
|
+
argSchema: string | null;
|
|
8281
|
+
}
|
|
8282
|
+
|
|
8283
|
+
/**
|
|
8284
|
+
* @public Named, overridable actions for one engine. Actions are either JS
|
|
8285
|
+
* closures you register or engine defaults (e.g. undo/redo), and
|
|
8286
|
+
* either kind can override the other by reusing the id.
|
|
8287
|
+
*
|
|
8288
|
+
* JS-registered actions run directly in JS, so on the web you get full fidelity:
|
|
8289
|
+
* {@link get} hands back the raw function and {@link run} passes args/results by
|
|
8290
|
+
* reference (non-serializable payloads like File/Blob work). The engine also keeps
|
|
8291
|
+
* a JSON trampoline per action so defaults run natively and host actions stay
|
|
8292
|
+
* reachable across the FFI — that path is JSON-only and async. Engine defaults you
|
|
8293
|
+
* have not overridden are reachable only via {@link run}; {@link get} returns undefined.
|
|
8294
|
+
*
|
|
8295
|
+
* @remarks Main-thread only. {@link get} is web-only; use run/has/list cross-platform.
|
|
8296
|
+
*/
|
|
8297
|
+
export declare class EngineActions {
|
|
8298
|
+
#private;
|
|
8299
|
+
|
|
8300
|
+
/**
|
|
8301
|
+
* Register an action, replacing any existing one with the same id.
|
|
8302
|
+
*
|
|
8303
|
+
* @param id - The action id (e.g. `undo`). Reusing an engine default's id overrides it.
|
|
8304
|
+
* @param fn - The action body (sync or async). On the web it runs directly with
|
|
8305
|
+
* any JS values. Across the FFI args/results are JSON, so only serializable
|
|
8306
|
+
* payloads work there.
|
|
8307
|
+
*/
|
|
8308
|
+
register<K extends EngineActionId>(id: K, fn: EngineActionsRegistry[K] extends (...args: any[]) => any ? EngineActionsRegistry[K] : EngineCustomActionFunction): void;
|
|
8309
|
+
register(id: string, fn: EngineCustomActionFunction): void;
|
|
8310
|
+
/**
|
|
8311
|
+
* Get the raw registered function for an id so you can call it synchronously.
|
|
8312
|
+
*
|
|
8313
|
+
* Returns the exact function you registered. Returns `undefined` for unknown ids
|
|
8314
|
+
* and engine-default native actions (which have no JS function) — use {@link run}
|
|
8315
|
+
* for those.
|
|
8316
|
+
*
|
|
8317
|
+
* @remarks Web-only.
|
|
8318
|
+
*/
|
|
8319
|
+
get<K extends EngineActionId>(id: K): EngineActionsRegistry[K] | undefined;
|
|
8320
|
+
get(id: string): EngineCustomActionFunction | undefined;
|
|
8321
|
+
/**
|
|
8322
|
+
* Run an action by id and return its result as a Promise.
|
|
8323
|
+
*
|
|
8324
|
+
* JS-registered actions are called directly (args/result by reference). Engine
|
|
8325
|
+
* defaults go across the FFI (JSON args/result).
|
|
8326
|
+
*
|
|
8327
|
+
* @param id - The action id.
|
|
8328
|
+
* @param args - Arguments forwarded to the action.
|
|
8329
|
+
* @returns The action's result, or a rejection if the id is unknown or it threw.
|
|
8330
|
+
*/
|
|
8331
|
+
run<K extends EngineActionId>(id: K, ...args: EngineActionsRegistry[K] extends (...args: infer A) => any ? A : unknown[]): Promise<EngineActionsRegistry[K] extends (...args: any[]) => infer R ? Awaited<R> : unknown>;
|
|
8332
|
+
run<R = unknown>(id: string, ...args: unknown[]): Promise<R>;
|
|
8333
|
+
/** Whether an action with this id is registered (host or engine default). */
|
|
8334
|
+
has(id: string): boolean;
|
|
8335
|
+
/**
|
|
8336
|
+
* Remove a host action, or revert an overridden engine default to its built-in.
|
|
8337
|
+
*
|
|
8338
|
+
* If you override an engine default (such as `select` or `undo`), unregistering the id restores
|
|
8339
|
+
* the default rather than leaving it unhandled. A custom id you registered yourself is removed
|
|
8340
|
+
* entirely. Returns `false` only when the id is unknown.
|
|
8341
|
+
*/
|
|
8342
|
+
unregister(id: string): boolean;
|
|
8343
|
+
/** List registered actions, optionally filtered by a `*` glob matcher on the id. */
|
|
8344
|
+
list(options?: {
|
|
8345
|
+
matcher?: string;
|
|
8346
|
+
}): EngineActionInfo[];
|
|
8347
|
+
|
|
8348
|
+
}
|
|
8349
|
+
|
|
8350
|
+
/**
|
|
8351
|
+
* @public Hook for hosts to add strongly-typed action ids. Augment via
|
|
8352
|
+
* `declare module '@cesdk/engine'` to get autocomplete on register/run while
|
|
8353
|
+
* still allowing custom string ids.
|
|
8354
|
+
*/
|
|
8355
|
+
export declare interface EngineActionsRegistry {
|
|
8356
|
+
}
|
|
8357
|
+
|
|
8358
|
+
/** @public A generic, untyped action function for custom ids. */
|
|
8359
|
+
export declare type EngineCustomActionFunction = (...args: any[]) => unknown;
|
|
8360
|
+
|
|
8102
8361
|
/**
|
|
8103
8362
|
* Represents an engine plugin.
|
|
8104
8363
|
*
|
|
@@ -9882,6 +10141,7 @@ export declare interface Settings {
|
|
|
9882
10141
|
|
|
9883
10142
|
|
|
9884
10143
|
|
|
10144
|
+
|
|
9885
10145
|
|
|
9886
10146
|
|
|
9887
10147
|
}
|
package/index.d.ts
CHANGED
|
@@ -1022,6 +1022,8 @@ export declare interface AssetPayload {
|
|
|
1022
1022
|
typeface?: Typeface;
|
|
1023
1023
|
transformPreset?: AssetTransformPreset;
|
|
1024
1024
|
properties?: AssetProperty[];
|
|
1025
|
+
/** A declarative style preset the engine applies to text/caption blocks. */
|
|
1026
|
+
stylePreset?: AssetStylePreset;
|
|
1025
1027
|
}
|
|
1026
1028
|
|
|
1027
1029
|
/**
|
|
@@ -1311,6 +1313,166 @@ export declare interface AssetStringProperty {
|
|
|
1311
1313
|
defaultValue: string;
|
|
1312
1314
|
}
|
|
1313
1315
|
|
|
1316
|
+
/**
|
|
1317
|
+
* A declarative style preset the engine applies to text and caption blocks. The engine parses and
|
|
1318
|
+
* applies it identically on every platform. Lives in {@link AssetPayload.stylePreset}.
|
|
1319
|
+
*
|
|
1320
|
+
* Most of the look is in {@link AssetStylePreset.properties}; the other fields cover the font,
|
|
1321
|
+
* size-relative scaling and animations.
|
|
1322
|
+
* @public
|
|
1323
|
+
*/
|
|
1324
|
+
export declare interface AssetStylePreset {
|
|
1325
|
+
/**
|
|
1326
|
+
* The block type this preset is for. Used as the type to create when the preset is applied with no
|
|
1327
|
+
* target block, and as the apply filter (it only restyles a block of this type). Omitted applies to any
|
|
1328
|
+
* block. Style presets target text and caption blocks; the value is the longhand id, which the engine
|
|
1329
|
+
* matches against the block's `getType()`.
|
|
1330
|
+
*/
|
|
1331
|
+
blockType?: '//ly.img.ubq/text' | '//ly.img.ubq/caption';
|
|
1332
|
+
/**
|
|
1333
|
+
* How the preset combines with the block's current look. `'replace'` (the default) also clears the
|
|
1334
|
+
* decorations and animations the preset omits, so switching presets never stacks; `'merge'` layers
|
|
1335
|
+
* the preset on top, keeping everything it does not set. Either way the block's text content is never
|
|
1336
|
+
* touched, and its size only changes when the preset asks for it (`fontSize.resizeExistingOnApply`,
|
|
1337
|
+
* or a `text/path` baseline adopting its bounding box).
|
|
1338
|
+
*/
|
|
1339
|
+
mode?: 'replace' | 'merge';
|
|
1340
|
+
/**
|
|
1341
|
+
* Font to apply. The engine resolves `family` against the registered typefaces and matches
|
|
1342
|
+
* `weight`/`style`. Ignored when the family is empty or not registered.
|
|
1343
|
+
*/
|
|
1344
|
+
typeface?: {
|
|
1345
|
+
family: string;
|
|
1346
|
+
weight?: FontWeight;
|
|
1347
|
+
style?: FontStyle;
|
|
1348
|
+
};
|
|
1349
|
+
/**
|
|
1350
|
+
* Scene-relative font size. `scale` is a unitless multiplier on the scene's base font size (1 = the
|
|
1351
|
+
* base size), sizing a block created from the preset. With `resizeExistingOnApply: true` the same size
|
|
1352
|
+
* also resizes an existing block on apply. For an absolute size, set `properties['text/fontSize']`
|
|
1353
|
+
* instead (it takes precedence).
|
|
1354
|
+
*/
|
|
1355
|
+
fontSize?: {
|
|
1356
|
+
scale: number;
|
|
1357
|
+
resizeExistingOnApply?: boolean;
|
|
1358
|
+
};
|
|
1359
|
+
/**
|
|
1360
|
+
* Lengths that scale with the block's font size. Each entry sets its `property` to `ratio × fontSize`
|
|
1361
|
+
* — e.g. `{ property: 'stroke/width', ratio: 0.012 }` makes the stroke width `0.012 × fontSize`. Keeps
|
|
1362
|
+
* a preset's stroke width, drop-shadow offset/blur, … proportional at any size.
|
|
1363
|
+
*/
|
|
1364
|
+
scaleWithFontSize?: Array<{
|
|
1365
|
+
property: AssetStylePresetScalableProperty;
|
|
1366
|
+
ratio: number;
|
|
1367
|
+
}>;
|
|
1368
|
+
/**
|
|
1369
|
+
* The bulk of the look: typography plus the `fill/*`, `stroke/*`, `dropShadow/*` and
|
|
1370
|
+
* `backgroundColor/*` decorations with their `…/enabled` toggles. Known paths are value-checked and
|
|
1371
|
+
* autocomplete. See {@link AssetStylePresetProperties}.
|
|
1372
|
+
*/
|
|
1373
|
+
properties?: AssetStylePresetProperties;
|
|
1374
|
+
/** Entrance animation. */
|
|
1375
|
+
inAnimation?: AssetStylePresetAnimation;
|
|
1376
|
+
/** Exit animation. */
|
|
1377
|
+
outAnimation?: AssetStylePresetAnimation;
|
|
1378
|
+
/** Looping animation. */
|
|
1379
|
+
loopAnimation?: AssetStylePresetAnimation;
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
/**
|
|
1383
|
+
* An animation slot of an {@link AssetStylePreset} (`inAnimation`, `outAnimation` or `loopAnimation`).
|
|
1384
|
+
* @public
|
|
1385
|
+
*/
|
|
1386
|
+
export declare interface AssetStylePresetAnimation {
|
|
1387
|
+
/** The animation block type to apply, e.g. `'//ly.img.ubq/animation/slide'`. */
|
|
1388
|
+
type: AnimationTypeLonghand;
|
|
1389
|
+
/** Configures the animation as a map of its property paths to values. */
|
|
1390
|
+
properties?: AssetStylePresetAnimationProperties;
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
/**
|
|
1394
|
+
* The parameters of an {@link AssetStylePresetAnimation}: a map of the animation's property paths to
|
|
1395
|
+
* values. The animation's `animation/*` properties (e.g. `animation/slide/fade`,
|
|
1396
|
+
* `animation/grow/scaleFactor`) are value-checked and autocomplete, as are the animation controls
|
|
1397
|
+
* (`playback/duration`, `animationEasing`, `textWritingStyle`, `textWritingOverlap`); any other
|
|
1398
|
+
* property path is still accepted. These are animation paths, distinct from the block-property paths
|
|
1399
|
+
* in {@link AssetStylePresetProperties}.
|
|
1400
|
+
* @public
|
|
1401
|
+
*/
|
|
1402
|
+
export declare type AssetStylePresetAnimationProperties = {
|
|
1403
|
+
[K in Extract<BoolPropertyName, `animation/${string}`>]?: boolean;
|
|
1404
|
+
} & {
|
|
1405
|
+
[K in Extract<EnumPropertyName, `animation/${string}`>]?: string;
|
|
1406
|
+
} & {
|
|
1407
|
+
[K in Extract<FloatPropertyName, `animation/${string}`>]?: number;
|
|
1408
|
+
} & {
|
|
1409
|
+
[K in Extract<ColorPropertyName, `animation/${string}`>]?: RGBColor | RGBAColor;
|
|
1410
|
+
} & {
|
|
1411
|
+
/** Animation controls applied outside the `animation/*` properties. */
|
|
1412
|
+
'playback/duration'?: number;
|
|
1413
|
+
animationEasing?: string;
|
|
1414
|
+
textWritingStyle?: string;
|
|
1415
|
+
textWritingOverlap?: number;
|
|
1416
|
+
} & {
|
|
1417
|
+
[path: string]: AssetStylePresetPropertyValue;
|
|
1418
|
+
};
|
|
1419
|
+
|
|
1420
|
+
/**
|
|
1421
|
+
* The look of an {@link AssetStylePreset}: a map of property paths to values. Known paths are
|
|
1422
|
+
* value-checked and autocomplete (e.g. `stroke/enabled` must be a boolean, `stroke/width` a number,
|
|
1423
|
+
* `fill/solid/color` a color); any other property path is still accepted with the broader
|
|
1424
|
+
* {@link AssetStylePresetPropertyValue}. Keys without a `/` are namespaced to the block (`text/` or
|
|
1425
|
+
* `caption/`); keys with a `/` are used verbatim.
|
|
1426
|
+
* @public
|
|
1427
|
+
*/
|
|
1428
|
+
export declare type AssetStylePresetProperties = {
|
|
1429
|
+
[K in BoolPropertyName as string extends K ? never : K]?: boolean;
|
|
1430
|
+
} & {
|
|
1431
|
+
[K in IntPropertyName as string extends K ? never : K]?: number;
|
|
1432
|
+
} & {
|
|
1433
|
+
[K in FloatPropertyName as string extends K ? never : K]?: number;
|
|
1434
|
+
} & {
|
|
1435
|
+
[K in DoublePropertyName as string extends K ? never : K]?: number;
|
|
1436
|
+
} & {
|
|
1437
|
+
[K in StringPropertyName as string extends K ? never : K]?: string;
|
|
1438
|
+
} & {
|
|
1439
|
+
[K in EnumPropertyName as string extends K ? never : K]?: string;
|
|
1440
|
+
} & {
|
|
1441
|
+
[K in ColorPropertyName as string extends K ? never : K]?: RGBColor | RGBAColor;
|
|
1442
|
+
} & {
|
|
1443
|
+
/**
|
|
1444
|
+
* The text-on-path baseline (see `setTextOnPath`): a single-subpath SVG path string in the block's
|
|
1445
|
+
* local coordinate space wraps the block's text on the path and resizes the block to the path's
|
|
1446
|
+
* bounding box; an explicit `null` clears the path and restores normal layout. This is a virtual
|
|
1447
|
+
* preset property — the baseline path is not a reflected block property, so the engine routes it
|
|
1448
|
+
* through `setTextOnPath`, inheriting its validation. Pair it with `text/pathOffset` and
|
|
1449
|
+
* `text/pathFlipped` (plain reflected properties) to fully define the path state. Which curve is
|
|
1450
|
+
* applied is identified by the path value itself — compare `getTextOnPath` against an entry's
|
|
1451
|
+
* `text/path`.
|
|
1452
|
+
*/
|
|
1453
|
+
'text/path'?: string | null;
|
|
1454
|
+
} & {
|
|
1455
|
+
[path: string]: AssetStylePresetPropertyValue;
|
|
1456
|
+
};
|
|
1457
|
+
|
|
1458
|
+
/**
|
|
1459
|
+
* A value a style preset can set on a property: a boolean, number, string (including enum values) or
|
|
1460
|
+
* an RGB(A) color. Colors must be RGB(A) (`{ r, g, b, a? }`); CMYK and spot colors are not supported in
|
|
1461
|
+
* presets. Structs and source sets cannot be set from a preset. A `null` value is ignored for regular
|
|
1462
|
+
* properties; for the virtual `text/path` property it clears the baseline path.
|
|
1463
|
+
* @public
|
|
1464
|
+
*/
|
|
1465
|
+
export declare type AssetStylePresetPropertyValue = boolean | number | string | RGBColor | RGBAColor | null;
|
|
1466
|
+
|
|
1467
|
+
/**
|
|
1468
|
+
* A length property a style preset may scale with the block's font size (see
|
|
1469
|
+
* {@link AssetStylePreset.scaleWithFontSize}). Restricted to the decoration lengths for which scaling is
|
|
1470
|
+
* meaningful — stroke width, drop-shadow offset/blur and the caption background corner radius — not
|
|
1471
|
+
* arbitrary numeric properties like `rotation` or `opacity`.
|
|
1472
|
+
* @public
|
|
1473
|
+
*/
|
|
1474
|
+
export declare type AssetStylePresetScalableProperty = 'stroke/width' | 'dropShadow/offset/x' | 'dropShadow/offset/y' | 'dropShadow/blurRadius/x' | 'dropShadow/blurRadius/y' | 'backgroundColor/cornerRadius';
|
|
1475
|
+
|
|
1314
1476
|
/**
|
|
1315
1477
|
* Transform preset payload
|
|
1316
1478
|
* @public
|
|
@@ -6684,6 +6846,12 @@ declare class CreativeEngine {
|
|
|
6684
6846
|
event: EventAPI;
|
|
6685
6847
|
scene: SceneAPI;
|
|
6686
6848
|
variable: VariableAPI;
|
|
6849
|
+
/**
|
|
6850
|
+
* Register, run, and discover named, overridable actions. On headless Node the registry
|
|
6851
|
+
* starts with only the engine-default `ly.img.*` actions (no host UI), but the API is
|
|
6852
|
+
* identical to the browser engine.
|
|
6853
|
+
*/
|
|
6854
|
+
actions: EngineActions;
|
|
6687
6855
|
version: string;
|
|
6688
6856
|
|
|
6689
6857
|
/**
|
|
@@ -8099,6 +8267,97 @@ export declare type EffectTypeLonghand = `//ly.img.ubq/effect/${EffectTypeShorth
|
|
|
8099
8267
|
/** @public */
|
|
8100
8268
|
export declare type EffectTypeShorthand = (typeof EFFECT_TYPES)[number];
|
|
8101
8269
|
|
|
8270
|
+
/** @public Known action ids from {@link EngineActionsRegistry}. */
|
|
8271
|
+
export declare type EngineActionId = keyof EngineActionsRegistry & string;
|
|
8272
|
+
|
|
8273
|
+
/** @public Info about a registered action, from {@link EngineActions.list}. */
|
|
8274
|
+
export declare interface EngineActionInfo {
|
|
8275
|
+
/** The action id, e.g. `nudge`. */
|
|
8276
|
+
id: string;
|
|
8277
|
+
/** Whether the action currently says it can run. */
|
|
8278
|
+
enabled: boolean;
|
|
8279
|
+
/** Optional JSON description of the arguments it accepts. */
|
|
8280
|
+
argSchema: string | null;
|
|
8281
|
+
}
|
|
8282
|
+
|
|
8283
|
+
/**
|
|
8284
|
+
* @public Named, overridable actions for one engine. Actions are either JS
|
|
8285
|
+
* closures you register or engine defaults (e.g. undo/redo), and
|
|
8286
|
+
* either kind can override the other by reusing the id.
|
|
8287
|
+
*
|
|
8288
|
+
* JS-registered actions run directly in JS, so on the web you get full fidelity:
|
|
8289
|
+
* {@link get} hands back the raw function and {@link run} passes args/results by
|
|
8290
|
+
* reference (non-serializable payloads like File/Blob work). The engine also keeps
|
|
8291
|
+
* a JSON trampoline per action so defaults run natively and host actions stay
|
|
8292
|
+
* reachable across the FFI — that path is JSON-only and async. Engine defaults you
|
|
8293
|
+
* have not overridden are reachable only via {@link run}; {@link get} returns undefined.
|
|
8294
|
+
*
|
|
8295
|
+
* @remarks Main-thread only. {@link get} is web-only; use run/has/list cross-platform.
|
|
8296
|
+
*/
|
|
8297
|
+
export declare class EngineActions {
|
|
8298
|
+
#private;
|
|
8299
|
+
|
|
8300
|
+
/**
|
|
8301
|
+
* Register an action, replacing any existing one with the same id.
|
|
8302
|
+
*
|
|
8303
|
+
* @param id - The action id (e.g. `undo`). Reusing an engine default's id overrides it.
|
|
8304
|
+
* @param fn - The action body (sync or async). On the web it runs directly with
|
|
8305
|
+
* any JS values. Across the FFI args/results are JSON, so only serializable
|
|
8306
|
+
* payloads work there.
|
|
8307
|
+
*/
|
|
8308
|
+
register<K extends EngineActionId>(id: K, fn: EngineActionsRegistry[K] extends (...args: any[]) => any ? EngineActionsRegistry[K] : EngineCustomActionFunction): void;
|
|
8309
|
+
register(id: string, fn: EngineCustomActionFunction): void;
|
|
8310
|
+
/**
|
|
8311
|
+
* Get the raw registered function for an id so you can call it synchronously.
|
|
8312
|
+
*
|
|
8313
|
+
* Returns the exact function you registered. Returns `undefined` for unknown ids
|
|
8314
|
+
* and engine-default native actions (which have no JS function) — use {@link run}
|
|
8315
|
+
* for those.
|
|
8316
|
+
*
|
|
8317
|
+
* @remarks Web-only.
|
|
8318
|
+
*/
|
|
8319
|
+
get<K extends EngineActionId>(id: K): EngineActionsRegistry[K] | undefined;
|
|
8320
|
+
get(id: string): EngineCustomActionFunction | undefined;
|
|
8321
|
+
/**
|
|
8322
|
+
* Run an action by id and return its result as a Promise.
|
|
8323
|
+
*
|
|
8324
|
+
* JS-registered actions are called directly (args/result by reference). Engine
|
|
8325
|
+
* defaults go across the FFI (JSON args/result).
|
|
8326
|
+
*
|
|
8327
|
+
* @param id - The action id.
|
|
8328
|
+
* @param args - Arguments forwarded to the action.
|
|
8329
|
+
* @returns The action's result, or a rejection if the id is unknown or it threw.
|
|
8330
|
+
*/
|
|
8331
|
+
run<K extends EngineActionId>(id: K, ...args: EngineActionsRegistry[K] extends (...args: infer A) => any ? A : unknown[]): Promise<EngineActionsRegistry[K] extends (...args: any[]) => infer R ? Awaited<R> : unknown>;
|
|
8332
|
+
run<R = unknown>(id: string, ...args: unknown[]): Promise<R>;
|
|
8333
|
+
/** Whether an action with this id is registered (host or engine default). */
|
|
8334
|
+
has(id: string): boolean;
|
|
8335
|
+
/**
|
|
8336
|
+
* Remove a host action, or revert an overridden engine default to its built-in.
|
|
8337
|
+
*
|
|
8338
|
+
* If you override an engine default (such as `select` or `undo`), unregistering the id restores
|
|
8339
|
+
* the default rather than leaving it unhandled. A custom id you registered yourself is removed
|
|
8340
|
+
* entirely. Returns `false` only when the id is unknown.
|
|
8341
|
+
*/
|
|
8342
|
+
unregister(id: string): boolean;
|
|
8343
|
+
/** List registered actions, optionally filtered by a `*` glob matcher on the id. */
|
|
8344
|
+
list(options?: {
|
|
8345
|
+
matcher?: string;
|
|
8346
|
+
}): EngineActionInfo[];
|
|
8347
|
+
|
|
8348
|
+
}
|
|
8349
|
+
|
|
8350
|
+
/**
|
|
8351
|
+
* @public Hook for hosts to add strongly-typed action ids. Augment via
|
|
8352
|
+
* `declare module '@cesdk/engine'` to get autocomplete on register/run while
|
|
8353
|
+
* still allowing custom string ids.
|
|
8354
|
+
*/
|
|
8355
|
+
export declare interface EngineActionsRegistry {
|
|
8356
|
+
}
|
|
8357
|
+
|
|
8358
|
+
/** @public A generic, untyped action function for custom ids. */
|
|
8359
|
+
export declare type EngineCustomActionFunction = (...args: any[]) => unknown;
|
|
8360
|
+
|
|
8102
8361
|
/**
|
|
8103
8362
|
* Represents an engine plugin.
|
|
8104
8363
|
*
|
|
@@ -9882,6 +10141,7 @@ export declare interface Settings {
|
|
|
9882
10141
|
|
|
9883
10142
|
|
|
9884
10143
|
|
|
10144
|
+
|
|
9885
10145
|
|
|
9886
10146
|
|
|
9887
10147
|
}
|