mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
feat(cuss): type definitions for cuss v1.18 (#42463)
- type definitions - tests https://github.com/words/cuss#api Thanks!
This commit is contained in:
parent
fcd2e522f6
commit
2e24b340b9
3
types/cuss/ar-latn.d.ts
vendored
Normal file
3
types/cuss/ar-latn.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import cuss = require('./');
|
||||
|
||||
export = cuss;
|
||||
18
types/cuss/cuss-tests.ts
Normal file
18
types/cuss/cuss-tests.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import cuss = require('cuss');
|
||||
import cussArgentinian = require('cuss/ar-latn');
|
||||
import cussEspagniol = require('cuss/es');
|
||||
import cussFrancais = require('cuss/fr');
|
||||
import cussItalian = require('cuss/it');
|
||||
import cussPortuguese = require('cuss/pt-br');
|
||||
|
||||
Object.keys(cuss).length; // $ExpectType number
|
||||
cuss.beaver; // $ExpectType SurenessRating
|
||||
cuss.asshat; // $ExpectType SurenessRating
|
||||
|
||||
cussArgentinian; // $ExpectType Cuss
|
||||
cussEspagniol; // $ExpectType Cuss
|
||||
cussFrancais; // $ExpectType Cuss
|
||||
cussItalian; // $ExpectType Cuss
|
||||
Object.keys(cussPortuguese).length; // $ExpectType number
|
||||
cussPortuguese.burro; // $ExpectType SurenessRating
|
||||
cussPortuguese.bixa; // $ExpectType SurenessRating
|
||||
3
types/cuss/es.d.ts
vendored
Normal file
3
types/cuss/es.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import cuss = require('./');
|
||||
|
||||
export = cuss;
|
||||
3
types/cuss/fr.d.ts
vendored
Normal file
3
types/cuss/fr.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import cuss = require('./');
|
||||
|
||||
export = cuss;
|
||||
23
types/cuss/index.d.ts
vendored
Normal file
23
types/cuss/index.d.ts
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// Type definitions for cuss 1.18
|
||||
// Project: https://github.com/words/cuss#readme
|
||||
// Definitions by: Piotr Błażejewicz (Peter Blazejewicz) <https://github.com/peterblazejewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/** how likely it is to be used as either profanity or clean text */
|
||||
type SurenessRating = 0 | 1 | 2;
|
||||
|
||||
type Cuss = object & {
|
||||
/**
|
||||
* Map of profanities to sureness rating
|
||||
*/
|
||||
[phrase: string]: SurenessRating;
|
||||
};
|
||||
|
||||
/**
|
||||
* `cuss` is a dictionary of phrases to ratings (Object.<number>), where each key can be considered a profanity,
|
||||
* and each rating is a number between 0 and 2 (both including),
|
||||
* representing the certainty the key is used as a profanity depending on context.
|
||||
*/
|
||||
declare const cuss: Cuss;
|
||||
|
||||
export = cuss;
|
||||
3
types/cuss/it.d.ts
vendored
Normal file
3
types/cuss/it.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import cuss = require('./');
|
||||
|
||||
export = cuss;
|
||||
3
types/cuss/pt-br.d.ts
vendored
Normal file
3
types/cuss/pt-br.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import cuss = require('./');
|
||||
|
||||
export = cuss;
|
||||
23
types/cuss/tsconfig.json
Normal file
23
types/cuss/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"cuss-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/cuss/tslint.json
Normal file
1
types/cuss/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user