@shotstack/shotstack-studio 2.10.2 → 2.11.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.ts CHANGED
@@ -192,7 +192,7 @@ export declare class Edit {
192
192
  * Move a clip identified by stable ID to a different track and/or start time.
193
193
  */
194
194
  moveClipById(clipId: string, toTrackIndex: number, newStart?: Seconds): Promise<void>;
195
- addClip(trackIdx: number, clip: Clip): void | Promise<void>;
195
+ addClip(trackIdx: number, clip: Clip): Promise<void>;
196
196
  addSvgClip(svgMarkup: string, opts?: {
197
197
  trackIndex?: number;
198
198
  start?: Seconds;
@@ -219,6 +219,16 @@ export declare class Edit {
219
219
  canDeleteClip(trackIdx: number, clipIdx: number): boolean;
220
220
  deleteClip(trackIdx: number, clipIdx: number): Promise<void>;
221
221
  addTrack(trackIdx: number, track: Track): Promise<void>;
222
+ /**
223
+ * Add a font to the timeline.
224
+ */
225
+ addFont(src: string): Promise<void>;
226
+ /**
227
+ * Replace timeline fonts wholesale.
228
+ */
229
+ setFonts(fonts: Array<{
230
+ src: string;
231
+ }>): Promise<void>;
222
232
  /**
223
233
  * Auto-link rich-caption clips to the first eligible source clip.
224
234
  * If an alias reference in the caption's src can't be resolved, link it automatically.
@@ -233,6 +243,10 @@ export declare class Edit {
233
243
  */
234
244
  private addCommandToHistory;
235
245
  updateClip(trackIdx: number, clipIdx: number, updates: Partial<Clip>): Promise<void>;
246
+ /**
247
+ * HEAD-check every external http(s) URL in a payload
248
+ */
249
+ private preflightAssetUrls;
236
250
  /**
237
251
  * Handle command result - only add to history if successful.
238
252
  */
@@ -97,7 +97,7 @@ export declare class Edit {
97
97
  * Move a clip identified by stable ID to a different track and/or start time.
98
98
  */
99
99
  moveClipById(clipId: string, toTrackIndex: number, newStart?: Seconds): Promise<void>;
100
- addClip(trackIdx: number, clip: Clip): void | Promise<void>;
100
+ addClip(trackIdx: number, clip: Clip): Promise<void>;
101
101
  addSvgClip(svgMarkup: string, opts?: {
102
102
  trackIndex?: number;
103
103
  start?: Seconds;
@@ -124,6 +124,16 @@ export declare class Edit {
124
124
  canDeleteClip(trackIdx: number, clipIdx: number): boolean;
125
125
  deleteClip(trackIdx: number, clipIdx: number): Promise<void>;
126
126
  addTrack(trackIdx: number, track: Track): Promise<void>;
127
+ /**
128
+ * Add a font to the timeline.
129
+ */
130
+ addFont(src: string): Promise<void>;
131
+ /**
132
+ * Replace timeline fonts wholesale.
133
+ */
134
+ setFonts(fonts: Array<{
135
+ src: string;
136
+ }>): Promise<void>;
127
137
  /**
128
138
  * Auto-link rich-caption clips to the first eligible source clip.
129
139
  * If an alias reference in the caption's src can't be resolved, link it automatically.
@@ -138,6 +148,10 @@ export declare class Edit {
138
148
  */
139
149
  private addCommandToHistory;
140
150
  updateClip(trackIdx: number, clipIdx: number, updates: Partial<Clip>): Promise<void>;
151
+ /**
152
+ * HEAD-check every external http(s) URL in a payload
153
+ */
154
+ private preflightAssetUrls;
141
155
  /**
142
156
  * Handle command result - only add to history if successful.
143
157
  */
@@ -363,6 +377,18 @@ declare class EventEmitter<TEventPayloadMap extends EventPayloadMap = EventPaylo
363
377
 
364
378
  declare type EventPayloadMap<TPayload = any> = Record<string, TPayload>;
365
379
 
380
+ /**
381
+ * Thrown by mutation methods (addClip, addTrack, addFont, setFonts) when a
382
+ * referenced asset/font URL fails preflight.
383
+ */
384
+ export declare class InvalidAssetUrlError extends Error {
385
+ readonly code: "INVALID_ASSET_URL";
386
+ readonly url: string;
387
+ readonly status: number | undefined;
388
+ readonly reason: string;
389
+ constructor(url: string, status: number | undefined, reason: string);
390
+ }
391
+
366
392
  declare type Listener<TPayload = any> = (payload: TPayload) => void;
367
393
 
368
394
  /**