@designcombo/state 3.1.13 → 4.0.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/events.d.ts CHANGED
@@ -5,6 +5,8 @@ export declare const TRACKS_CHANGED = "track:changed";
5
5
  export declare const TRACK_ITEMS_CHANGED = "trackItems:changed";
6
6
  export declare const STATE_PREFIX = "state";
7
7
  export declare const STATE_CHANGED = "state:changed";
8
+ export declare const BULK_PREFIX = "bulk";
9
+ export declare const EDIT_BULK = "bulk:edit";
8
10
  export declare const DESIGN_PREFIX = "design";
9
11
  export declare const DESIGN_LOAD = "design:load";
10
12
  export declare const DESIGN_RESIZE = "design:resize";
@@ -12,6 +14,7 @@ export declare const ADD_PREFIX = "add";
12
14
  export declare const ADD_TEXT = "add:text";
13
15
  export declare const ADD_VIDEO = "add:video";
14
16
  export declare const ADD_AUDIO = "add:audio";
17
+ export declare const ADD_CUSTOM_ITEM = "add:customItem";
15
18
  export declare const ADD_PLACEHOLDER = "add:placeholder";
16
19
  export declare const ADD_IMAGE = "add:image";
17
20
  export declare const ADD_ILLUSTRATION = "add:illustration";
@@ -30,6 +33,7 @@ export declare const EDIT_TEXT = "edit:text";
30
33
  export declare const EDIT_SHAPE = "edit:shape";
31
34
  export declare const EDIT_TEMPLATE_ITEM = "edit:templateItem";
32
35
  export declare const DELETE_TEMPLATE_ITEM = "edit:deleteTemplateItem";
36
+ export declare const EDIT_BACKGROUND_EDITOR = "edit:backgroundEditor";
33
37
  export declare const ENTER_EDIT_MODE = "enterEditMode";
34
38
  export declare const ACTIVE_PREFIX = "active";
35
39
  export declare const ACTIVE_SET = "active:set";
@@ -0,0 +1,13 @@
1
+ import { State } from '@designcombo/types';
2
+
3
+ interface Animations {
4
+ in?: any;
5
+ out?: any;
6
+ loop?: any;
7
+ }
8
+ interface AnimationPayload {
9
+ id: string;
10
+ animations: Animations;
11
+ }
12
+ export declare function addAnimation(state: State, payload: AnimationPayload): Partial<State>;
13
+ export {};
@@ -0,0 +1,8 @@
1
+ import { State, IAudio } from '@designcombo/types';
2
+
3
+ interface AddAudioOptions {
4
+ targetTrackIndex?: number;
5
+ targetTrackId?: string;
6
+ }
7
+ export declare function addAudio(state: State, payload: IAudio, options?: AddAudioOptions): Promise<Partial<State>>;
8
+ export {};
@@ -0,0 +1,17 @@
1
+ import { State, ICaption, ITrack } from '@designcombo/types';
2
+
3
+ interface CaptionsPayload {
4
+ trackItems: ICaption[];
5
+ tracks: ITrack[];
6
+ }
7
+ interface CaptionsOptions {
8
+ trackIndex?: number;
9
+ trackId?: string;
10
+ isNewTrack?: boolean;
11
+ size?: {
12
+ width: number;
13
+ height: number;
14
+ };
15
+ }
16
+ export declare function addCaptions(state: State, payload: CaptionsPayload, options?: CaptionsOptions): Promise<Partial<State>>;
17
+ export {};
@@ -0,0 +1,10 @@
1
+ import { State, IComposition } from '@designcombo/types';
2
+
3
+ interface CompositionOptions {
4
+ targetTrackIndex?: number;
5
+ targetTrackId?: string;
6
+ scaleMode?: string;
7
+ scaleAspectRatio?: number;
8
+ }
9
+ export declare function addComposition(state: State, payload: IComposition, options?: CompositionOptions): Promise<Partial<State>>;
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import { State, ICustom } from '@designcombo/types';
2
+
3
+ interface CustomOptions {
4
+ targetTrackIndex?: number;
5
+ targetTrackId?: string;
6
+ scaleMode?: string;
7
+ scaleAspectRatio?: number;
8
+ }
9
+ export declare function addCustom(state: State, payload: ICustom, options?: CustomOptions): Promise<Partial<State>>;
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import { State, IIllustration } from '@designcombo/types';
2
+
3
+ interface IllustrationOptions {
4
+ targetTrackIndex?: number;
5
+ targetTrackId?: string;
6
+ scaleMode?: string;
7
+ scaleAspectRatio?: number;
8
+ }
9
+ export declare function addIllustration(state: State, payload: IIllustration, options?: IllustrationOptions): Promise<Partial<State>>;
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import { State, IImage } from '@designcombo/types';
2
+
3
+ interface AddImageOptions {
4
+ targetTrackIndex?: number;
5
+ targetTrackId?: string;
6
+ scaleMode?: string;
7
+ scaleAspectRatio?: number;
8
+ }
9
+ export declare function addImage(state: State, payload: IImage, options?: AddImageOptions): Promise<Partial<State>>;
10
+ export {};
@@ -0,0 +1,11 @@
1
+ import { State, ITrack } from '@designcombo/types';
2
+
3
+ interface ItemsPayload {
4
+ trackItems: any[];
5
+ tracks: ITrack[];
6
+ }
7
+ interface ItemsOptions {
8
+ trackIndex?: number;
9
+ }
10
+ export declare function addItems(state: State, payload: ItemsPayload, options?: ItemsOptions): Promise<Partial<State>>;
11
+ export {};
@@ -0,0 +1,10 @@
1
+ import { State, IShape } from '@designcombo/types';
2
+
3
+ interface ShapeOptions {
4
+ targetTrackIndex?: number;
5
+ targetTrackId?: string;
6
+ scaleMode?: string;
7
+ scaleAspectRatio?: number;
8
+ }
9
+ export declare function addShape(state: State, payload: IShape, options?: ShapeOptions): Promise<Partial<State>>;
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import { State, ITemplate } from '@designcombo/types';
2
+
3
+ interface TemplateOptions {
4
+ targetTrackIndex?: number;
5
+ targetTrackId?: string;
6
+ scaleMode?: string;
7
+ scaleAspectRatio?: number;
8
+ }
9
+ export declare function addTemplate(state: State, payload: ITemplate, options?: TemplateOptions): Promise<Partial<State>>;
10
+ export {};
@@ -0,0 +1,13 @@
1
+ import { State, IText } from '@designcombo/types';
2
+
3
+ interface TextOptions {
4
+ targetTrackIndex?: number;
5
+ targetTrackId?: string;
6
+ isNewTrack?: boolean;
7
+ size?: {
8
+ width: number;
9
+ height: number;
10
+ };
11
+ }
12
+ export declare function addText(state: State, payload: Partial<IText>, options?: TextOptions): Promise<Partial<State>>;
13
+ export {};
@@ -0,0 +1,10 @@
1
+ import { State, IVideo } from '@designcombo/types';
2
+
3
+ interface AddVideoOptions {
4
+ targetTrackIndex?: number;
5
+ targetTrackId?: string;
6
+ scaleMode?: string;
7
+ scaleAspectRatio?: number;
8
+ }
9
+ export declare function addVideo(state: State, payload: IVideo, options?: AddVideoOptions): Promise<Partial<State>>;
10
+ export {};
@@ -0,0 +1,3 @@
1
+ import { State } from '@designcombo/types';
2
+
3
+ export declare function copyLayer(state: State): void;
@@ -0,0 +1,3 @@
1
+ import { State } from '@designcombo/types';
2
+
3
+ export declare function deleteLayer(state: State, trackItemIds?: string[]): Partial<State>;
@@ -0,0 +1,3 @@
1
+ import { State } from '@designcombo/types';
2
+
3
+ export declare function duplicateLayer(state: State, trackItemIds?: string[]): Partial<State>;
@@ -0,0 +1,8 @@
1
+ import { State } from '@designcombo/types';
2
+
3
+ interface BackgroundUpdate {
4
+ type?: "color" | "image";
5
+ value: any;
6
+ }
7
+ export declare function editBackground(state: State, update: BackgroundUpdate): Partial<State>;
8
+ export {};
@@ -0,0 +1,3 @@
1
+ import { State } from '@designcombo/types';
2
+
3
+ export declare function editObject(state: State, payload: Record<string, any>): Promise<Partial<State>>;
@@ -0,0 +1,3 @@
1
+ import { State } from '@designcombo/types';
2
+
3
+ export declare function loadDesign(_: State, data: any): Promise<Partial<State>>;
@@ -0,0 +1,3 @@
1
+ import { State } from '@designcombo/types';
2
+
3
+ export declare function pasteLayer(state: State): Promise<Partial<State>>;
@@ -0,0 +1,3 @@
1
+ import { State, IItem } from '@designcombo/types';
2
+
3
+ export declare function replaceLayer(state: State, data: Record<string, IItem>): Promise<Partial<State>>;
@@ -0,0 +1,3 @@
1
+ import { State, IItem } from '@designcombo/types';
2
+
3
+ export declare function replaceMedia(state: State, data: Record<string, IItem>): Promise<Partial<State>>;
@@ -0,0 +1,3 @@
1
+ import { State } from '@designcombo/types';
2
+
3
+ export declare function splitLayer(state: State, time: number): Partial<State>;