@idraw/types
Advanced tools
Comparing version 0.4.0-beta.24 to 0.4.0-beta.25
{ | ||
"name": "@idraw/types", | ||
"version": "0.4.0-beta.24", | ||
"version": "0.4.0-beta.25", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "src/index.ts", |
import type { ElementBaseDetail, ElementTextDetail, ElementGroupDetail } from './element'; | ||
export type DefaultElementDetailConfig = Required<Omit<ElementBaseDetail, 'clipPath' | 'background'>> & | ||
Required<Pick<ElementTextDetail, 'color' | 'textAlign' | 'verticalAlign' | 'fontSize' | 'fontFamily' | 'fontWeight'>> & | ||
Required<Pick<ElementTextDetail, 'color' | 'textAlign' | 'verticalAlign' | 'fontSize' | 'fontFamily' | 'fontWeight' | 'minInlineSize' | 'wordBreak'>> & | ||
Required<Pick<ElementGroupDetail, 'overflow'>>; |
@@ -1,2 +0,2 @@ | ||
import type { Element, ElementType, ElementAssets, ElementSize, ElementGroupDetail } from './element'; | ||
import type { Element, ElementType, ElementAssets, ElementSize, ElementGroupDetail, ElementGlobalDetail } from './element'; | ||
@@ -19,7 +19,9 @@ export type DataLayout = Pick<ElementSize, 'x' | 'y' | 'w' | 'h'> & { | ||
}; | ||
export interface Data<E extends Record<string, any> = Record<string, any>> { | ||
export type Data<E extends Record<string, any> = Record<string, any>> = { | ||
elements: Element<ElementType, E>[]; | ||
assets?: ElementAssets; | ||
layout?: DataLayout; | ||
} | ||
global?: ElementGlobalDetail; | ||
}; | ||
@@ -26,0 +28,0 @@ export type Matrix = [ |
@@ -85,2 +85,4 @@ import { PointSize } from './point'; | ||
clipPath?: ElementClipPath; | ||
clipPathStrokeWidth?: number; | ||
clipPathStrokeColor?: string; | ||
} | ||
@@ -110,2 +112,4 @@ | ||
textTransform?: 'none' | 'uppercase' | 'lowercase'; | ||
wordBreak?: 'break-all' | 'normal'; // default: 'normal' | ||
overflow?: 'hidden' | 'visible'; // default: 'hidden' | ||
} | ||
@@ -179,2 +183,6 @@ | ||
export interface ElementGlobalDetail { | ||
background?: string; | ||
} | ||
export interface Element<T extends ElementType = ElementType, E extends Record<string, any> = Record<string, any>> extends ElementSize { | ||
@@ -187,2 +195,3 @@ uuid: string; | ||
extends?: E; | ||
global?: ElementGlobalDetail; | ||
} | ||
@@ -189,0 +198,0 @@ |
import type { ViewScaleInfo, ViewCalculator, ViewSizeInfo } from './view'; | ||
import type { Element, ElementSize, ElementAssets } from './element'; | ||
import type { LoaderEventMap, LoadElementType, LoadContent, LoadItemMap } from './loader'; | ||
import type { UtilEventEmitter } from './util'; | ||
import type { UtilEventEmitter, RecursivePartial } from './util'; | ||
import type { StoreSharer } from './store'; | ||
@@ -46,2 +46,3 @@ import { ViewContext2D } from '@idraw/types'; | ||
parentOpacity: number; | ||
overrideElementMap?: Record<string, RecursivePartial<Element>> | null; | ||
} |
@@ -7,2 +7,4 @@ import { Data } from './data'; | ||
} from './view'; | ||
import { Element } from './element'; | ||
import { RecursivePartial } from './util'; | ||
@@ -12,3 +14,3 @@ export type ActiveStore = ViewSizeInfo & | ||
data: Data | null; | ||
// selectedViewRectVertexes: ViewRectVertexes | null; | ||
overrideElementMap: Record<string, RecursivePartial<Element>> | null; | ||
}; | ||
@@ -28,2 +30,4 @@ | ||
getActiveViewSizeInfo(): ViewSizeInfo; | ||
setActiveOverrideElemenentMap(map: Record<string, RecursivePartial<Element>> | null): void; | ||
getActiveOverrideElemenentMap(): Record<string, RecursivePartial<Element>> | null; | ||
} |
29522
832