Codeboard.
Technical referenceAPI signaturesData shapes

Drawing types

Data shapes for drawing. See all type groups for other domains and shared units. Import public types from codeboard-studio; helper shapes are included to explain nested values.

ResourceOrigin

Code
export interface ResourceOrigin {
    source: string;
    author?: string;
    license: string;
    redistribution: "allowed" | "unknown" | "forbidden";
}

BrushResource

Code
export interface BrushResource {
    id: string;
    name: string;
    role: "tip" | "texture";
    tip: Extract<BrushTip, {
        kind: "bitmap";
    }>;
    originalWidth: number;
    originalHeight: number;
    checksum: string;
    origin: ResourceOrigin;
}

ImportedPreset

Code
export interface ImportedPreset {
    name: string;
    engine: string;
    parameters: Record<string, string>;
    resourceIds: string[];
    mapped: Partial<Pick<BrushPreset, "spacing" | "opacity" | "flow">>;
    missingDependencies: string[];
    unsupported: string[];
}

BrushImportReport

Code
export interface BrushImportReport {
    format: string;
    source: ResourceOrigin;
    checksum: string;
    resources: BrushResource[];
    presets: ImportedPreset[];
    mapped: string[];
    missingDependencies: string[];
    unsupported: string[];
    warnings: string[];
}

ImportOptions

Code
export interface ImportOptions {
    origin: ResourceOrigin;
    maxTipSize?: number;
    maskMode?: "alpha" | "luminance" | "inverse-luminance";
    dependencies?: Record<string, Buffer>;
    role?: "tip" | "texture";
}

PathSamplingOptions

Code
export interface PathSamplingOptions {
    /** Maximum intended spacing in local canvas units; native curve measurement is approximate. */
    step?: number;
    /** Reject before native sampling if the control-polygon estimate exceeds this allocation budget. */
    maxSamples?: number;
}

PixelColor

Code
export type PixelColor = readonly [
    number,
    number,
    number,
    number
];

PixelComparison

Code
export interface PixelComparison {
    width: number;
    height: number;
    changedPixels: number;
    maxChannelDelta: number;
    meanAbsoluteDelta: number;
    bounds: PixelRegion | null;
}

PointLike

Code
export type PointLike = Pick<Point, "x" | "y"> & Partial<Omit<Point, "x" | "y">>;

PathBooleanOperation

Code
export type PathBooleanOperation = "union" | "intersect" | "difference" | "xor";

On this page