mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
@@ -0,0 +1,24 @@
|
||||
import badgen from 'badgen';
|
||||
|
||||
// $ExpectType string
|
||||
badgen({
|
||||
subject: 'SUBJECT',
|
||||
status: 'STATUS'
|
||||
});
|
||||
|
||||
// $ExpectType string
|
||||
badgen({
|
||||
subject: 'SUBJECT',
|
||||
status: 'STATUS',
|
||||
color: 'green'
|
||||
});
|
||||
|
||||
// $ExpectType string
|
||||
badgen({
|
||||
subject: 'SUBJECT',
|
||||
status: 'STATUS',
|
||||
color: '#FF0000',
|
||||
style: 'flat',
|
||||
icon: 'data:image/svg+xml;base64,...',
|
||||
iconWidth: 20
|
||||
});
|
||||
Vendored
+55
@@ -0,0 +1,55 @@
|
||||
// Type definitions for badgen 2.6
|
||||
// Project: https://github.com/amio/badgen
|
||||
// Definitions by: m5d215 <https://github.com/m5d215>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.7
|
||||
|
||||
type ColorPresets =
|
||||
| 'green'
|
||||
| 'blue'
|
||||
| 'red'
|
||||
| 'yellow'
|
||||
| 'orange'
|
||||
| 'purple'
|
||||
| 'pink'
|
||||
| 'grey'
|
||||
| 'gray'
|
||||
| 'cyan'
|
||||
| 'black';
|
||||
|
||||
interface BadgeCreationParams {
|
||||
/**
|
||||
* Text representing the subject.
|
||||
*/
|
||||
subject: string;
|
||||
|
||||
/**
|
||||
* Text representing the status.
|
||||
*/
|
||||
status: string;
|
||||
|
||||
/**
|
||||
* Color RGB or Color Name, optional.
|
||||
*/
|
||||
color?: ColorPresets | string;
|
||||
|
||||
/**
|
||||
* 'flat' or undefined, optional.
|
||||
*/
|
||||
style?: 'flat';
|
||||
|
||||
/**
|
||||
* Use icon, optional.
|
||||
*/
|
||||
icon?: string;
|
||||
|
||||
/**
|
||||
* Use this if icon is not square.
|
||||
* @default 13
|
||||
*/
|
||||
iconWidth?: number;
|
||||
}
|
||||
|
||||
declare function badgen(params: BadgeCreationParams): string;
|
||||
|
||||
export = badgen;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"badgen-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user