illustrator.js
Version:
JavaScript image processing library
39 lines (38 loc) • 1.17 kB
TypeScript
import { IllustratorImageSource } from "../image/ImageLoader";
export interface IllustratorDataSource {
name: string;
type: "text" | "image";
data: TextDataSource | ImageDataSource;
}
export interface TextDataSource {
value: string;
config: {
x: number;
y: number;
maxWidth?: number;
font: string;
fontPath?: string;
};
}
export interface ImageDataSource {
value: IllustratorImageSource;
config: {
x: number;
y: number;
width: number;
height: number;
radius?: number;
};
}
export declare class DataSource {
data: Array<IllustratorDataSource>;
loadData(data: Array<IllustratorDataSource>): void;
addData(data: IllustratorDataSource): void;
removeData(nameOrFn: string | ((ctx: IllustratorDataSource) => boolean)): void;
get(nameOrFn: string | ((ctx: IllustratorDataSource) => boolean)): IllustratorDataSource | undefined;
toJSON(): IllustratorDataSource[];
toArray(): IllustratorDataSource[];
toString(): `DataSource<${number}>`;
clone(): DataSource;
[Symbol.iterator](): IterableIterator<IllustratorDataSource>;
}