UNPKG

windups

Version:

A unique typewriter effect library for React.

18 lines (17 loc) 2.46 kB
export declare type WindupMember<ElementType, MetadataType> = ElementType | Windup<ElementType, MetadataType>; export declare type Windup<ElementType, MetadataType> = [Array<WindupMember<ElementType, MetadataType>>, Array<WindupMember<ElementType, MetadataType>>, MetadataType]; export declare function isPlayedWindup<ElementType, MetadataType>(windup: PlayedWindup<ElementType, MetadataType> | Windup<ElementType, MetadataType>): windup is PlayedWindup<ElementType, MetadataType>; export declare function memberIsWindup<ElementType, MetadataType>(member: WindupMember<ElementType, MetadataType>): member is Windup<ElementType, MetadataType>; export declare function windupFromString<MetadataType>(str: string, metadata: MetadataType): Windup<string, MetadataType>; export declare function newWindup<ElementType, MetadataType>(arg: Array<WindupMember<ElementType, MetadataType>>, metadata: MetadataType): Windup<ElementType, MetadataType>; export declare function isUnplayed<ElementType, MetadataType>(windup: Windup<ElementType, MetadataType>): boolean; export declare function isFinished<ElementType, MetadataType>([_played, remaining]: Windup<ElementType, MetadataType>): boolean; export declare function fastForward<ElementType, MetadataType>(windup: Windup<ElementType, MetadataType>): Windup<ElementType, MetadataType>; export declare function rewind<ElementType, MetadataType>(windup: Windup<ElementType, MetadataType>): Windup<ElementType, MetadataType>; export declare function windupAsString<MetadataType>(windup: Windup<string, MetadataType>): string; export declare function lastPlayedMember<ElementType, MetadataType>([played, remaining]: Windup<ElementType, MetadataType>): WindupMember<ElementType, MetadataType> | undefined; export declare function lastPlayedElement<ElementType, MetadataType>(windup: Windup<ElementType, MetadataType>): ElementType | undefined; export declare type PlayedWindup<ElementType, MetadataType> = [Array<ElementType>, MetadataType]; export declare function playedElements<ElementType, MetadataType>([played, remaining]: Windup<ElementType, MetadataType>): Array<ElementType | PlayedWindup<ElementType, MetadataType>>; export declare function nextElement<ElementType, MetadataType>([_played, remaining]: Windup<ElementType, MetadataType>): ElementType | undefined; export declare function next<ElementType, MetadataType>(windup: Windup<ElementType, MetadataType>): Windup<ElementType, MetadataType>;