@disjukr/croquis-js
Version:
drawing tool library
15 lines (14 loc) • 1.19 kB
TypeScript
import { StylusState } from '../stylus';
import type { StrokeProtocol, StrokeDrawingContext, ResultOfStrokeProtocol, StrokeDrawingContextFromProtocol, ConfigOfStrokeProtocol } from '../stroke-protocol';
export interface PulledStringConfig<TProxyTarget extends StrokeProtocol = any> {
stringLength: number;
targetConfig: ConfigOfStrokeProtocol<TProxyTarget>;
}
export declare const defaultPulledStringConfig: Omit<PulledStringConfig<any>, 'targetConfig'>;
export interface PulledStringState<TProxyTarget extends StrokeProtocol = any> {
targetDrawingContext: StrokeDrawingContextFromProtocol<TProxyTarget>;
follower: StylusState;
}
export declare type PulledStringDrawingContext<TProxyTarget extends StrokeProtocol = any> = StrokeDrawingContext<PulledStringConfig<TProxyTarget>, PulledStringState<TProxyTarget>>;
export declare function getStroke<TProxyTarget extends StrokeProtocol>(target: TProxyTarget): StrokeProtocol<PulledStringConfig<TProxyTarget>, PulledStringState<TProxyTarget>, ResultOfStrokeProtocol<TProxyTarget>>;
export declare function getGuidePathData(pointerX: number, pointerY: number, followerX: number, followerY: number, stringLength: number): string;