mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
Merge pull request #31295 from BendingBender/chalk-animation
Add types for chalk-animation
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import * as chalkAnimation from 'chalk-animation';
|
||||
|
||||
const rainbow: chalkAnimation.Animation = chalkAnimation.rainbow('Lorem ipsum dolor sit amet');
|
||||
chalkAnimation.rainbow('Lorem ipsum dolor sit amet', 2);
|
||||
chalkAnimation.pulse('Lorem ipsum dolor sit amet');
|
||||
chalkAnimation.pulse('Lorem ipsum dolor sit amet', 2);
|
||||
chalkAnimation.glitch('Lorem ipsum dolor sit amet');
|
||||
chalkAnimation.glitch('Lorem ipsum dolor sit amet', 2);
|
||||
chalkAnimation.radar('Lorem ipsum dolor sit amet');
|
||||
chalkAnimation.radar('Lorem ipsum dolor sit amet', 2);
|
||||
chalkAnimation.neon('Lorem ipsum dolor sit amet');
|
||||
chalkAnimation.neon('Lorem ipsum dolor sit amet', 2);
|
||||
chalkAnimation.karaoke('Lorem ipsum dolor sit amet');
|
||||
chalkAnimation.karaoke('Lorem ipsum dolor sit amet', 2);
|
||||
|
||||
rainbow.stop();
|
||||
rainbow.start();
|
||||
rainbow.replace('.');
|
||||
rainbow.render();
|
||||
// $ExpectType string
|
||||
rainbow.frame();
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
// Type definitions for chalk-animation 1.6
|
||||
// Project: https://github.com/bokub/chalk-animation
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export const rainbow: AnimationFn;
|
||||
export const pulse: AnimationFn;
|
||||
export const glitch: AnimationFn;
|
||||
export const radar: AnimationFn;
|
||||
export const neon: AnimationFn;
|
||||
export const karaoke: AnimationFn;
|
||||
|
||||
export type AnimationFn = (text: string, speed?: number) => Animation;
|
||||
|
||||
export interface Animation {
|
||||
start(): void;
|
||||
stop(): void;
|
||||
replace(text: string): void;
|
||||
render(): void;
|
||||
frame(): string;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"chalk-animation-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user