import { StyleProp, ViewStyle } from 'react-native'; import { Character, Positioner } from './hanzi-writer'; import type { Point, QuizOptions, CharacterJson } from './types'; import { ReactNode } from 'react'; import { PathProps, SvgProps } from 'react-native-svg'; export declare const HanziWriterContext: import("react").Context<{ animator: { useStore(selector: (state: CharacterAnimatorState) => T, equalityFn?: any): T; store: { subscribe: (listener: () => void) => () => void; getState: () => CharacterAnimatorState; setState(newState: Partial): void; }; animateCharacter(params?: { /** In milliseconds. Default: 400 */ strokeDuration?: number; /** In milliseconds. Default: 1500 */ delayBetweenStrokes?: number; onComplete?: () => void; }): void; cancelAnimation(): void; onAnimationComplete: () => void; }; quiz: { store: { next(): void; subscribe: (listener: () => void) => () => void; getState: () => QuizState; setState(newState: Partial): void; }; useStore(selector: (state: QuizState) => T, equalityFn?: any): T; check: (simplifiedPoints: Point[]) => void; start: (params: StartQuizParams) => void; stop: () => void; }; characterState: { status: "idle"; } | { status: "pending"; } | { status: "rejected"; error: Error; } | { status: "resolved"; data: Character; }; characterClass: Character | null; refetch: () => void; size: number; positioner: Positioner; } | null>; interface HanziWriterProps { writer: ReturnType; children: ReactNode; /** What to display while the character is loading */ loading?: React.ReactNode; /** What to display if there's an error */ error?: React.ReactNode; /** Container style */ style?: StyleProp; userStrokeProps?: PathProps; } export declare function HanziWriter(props: HanziWriterProps): import("react").JSX.Element; export declare namespace HanziWriter { var Svg: typeof HanziWriterSvg; var GridLines: typeof HanziWriterGridLines; var Outline: typeof HanziWriterOutline; var Character: typeof HanziWriterCharacter; var QuizMistakeHighlighter: typeof import("./HanziWriter").QuizMistakeHighlighter; var QuizStrokes: typeof HanziWriterQuizStrokes; } export declare function defaultCharDataLoader(char: string): Promise; export declare function QuizMistakeHighlighter({ color, strokeDuration, }: { color?: string | undefined; strokeDuration?: number | undefined; }): import("react").JSX.Element | null; /** Animates all strokes */ export declare function CharacterAnimator({ color, radicalColor, }: { color?: string; radicalColor?: string; }): import("react").JSX.Element | null; interface CharacterLoaderProps { /** What to display while the character is loading */ loading?: React.ReactNode; /** What to display if there's an error */ error?: React.ReactNode; /** Resolved character data */ children: ReactNode; } export declare function CharacterLoader({ loading, error, children, }: CharacterLoaderProps): string | number | bigint | true | import("react").JSX.Element | Iterable | Promise> | Iterable | null | undefined> | null; export type HanziWriterAnimationState = 'playing' | 'paused' | 'stopped' | 'cancelled'; /** This component handles everything to do with the user's gestures on the writer element */ export declare function UserStrokeGesture(props: PathProps): import("react").JSX.Element; interface HanziWriterSvgProps extends SvgProps { children?: ReactNode; } declare function HanziWriterSvg({ children, ...rest }: HanziWriterSvgProps): import("react").JSX.Element; declare function HanziWriterQuizStrokes(props: { color?: string; radicalColor?: string; }): import("react").JSX.Element; declare function HanziWriterCharacter(props: { color?: string; radicalColor?: string; }): import("react").JSX.Element; declare function HanziWriterOutline(props: { color?: string; }): import("react").JSX.Element | null; export declare function HanziWriterGridLines(props: { color?: string; width?: number; }): import("react").JSX.Element; type AvailableQuizOptions = Omit; type StartQuizParams = Partial; interface CharacterAnimatorState { character: string; state: 'playing' | 'stopped'; animationKey: string | null; onComplete: (() => void) | null; delayBetweenStrokes: number; strokeDuration: number; } type QuizState = { readonly active: false; character: string; index: number; mistakes: Record; params: null; } | { readonly active: true; character: string; index: number; mistakes: Record; params: StartQuizParams; }; export declare const useHanziWriter: (params: { character: string; loader?: (char: string) => Promise | CharacterJson; /** Optional widget size in px (default 300) */ size?: number; /** Optional padding for the Positioner (default 0) */ padding?: number; }) => { animator: { useStore(selector: (state: CharacterAnimatorState) => T, equalityFn?: any): T; store: { subscribe: (listener: () => void) => () => void; getState: () => CharacterAnimatorState; setState(newState: Partial): void; }; animateCharacter(params?: { /** In milliseconds. Default: 400 */ strokeDuration?: number; /** In milliseconds. Default: 1500 */ delayBetweenStrokes?: number; onComplete?: () => void; }): void; cancelAnimation(): void; onAnimationComplete: () => void; }; quiz: { store: { next(): void; subscribe: (listener: () => void) => () => void; getState: () => QuizState; setState(newState: Partial): void; }; useStore(selector: (state: QuizState) => T, equalityFn?: any): T; check: (simplifiedPoints: Point[]) => void; start: (params: StartQuizParams) => void; stop: () => void; }; characterState: { status: "idle"; } | { status: "pending"; } | { status: "rejected"; error: Error; } | { status: "resolved"; data: Character; }; characterClass: Character | null; refetch: () => void; size: number; positioner: Positioner; }; export {}; //# sourceMappingURL=HanziWriter.d.ts.map