mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
Add files for sloc. (#39405)
This commit is contained in:
109
types/sloc/index.d.ts
vendored
Normal file
109
types/sloc/index.d.ts
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
// Type definitions for sloc 0.2
|
||||
// Project: https://github.com/flosse/sloc#readme
|
||||
// Definitions by: Gary King <https://github.com/garyking>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
declare function sloc(code: string, extension: string, options?: sloc.Options): Record<sloc.Key, number>;
|
||||
|
||||
declare namespace sloc {
|
||||
const keys: Key[];
|
||||
|
||||
const extensions: Extension[];
|
||||
|
||||
interface Options {
|
||||
debug: boolean;
|
||||
}
|
||||
|
||||
type Extension =
|
||||
| 'asm'
|
||||
| 'brs'
|
||||
| 'c'
|
||||
| 'cc'
|
||||
| 'clj'
|
||||
| 'cljs'
|
||||
| 'cls'
|
||||
| 'coffee'
|
||||
| 'cpp'
|
||||
| 'cr'
|
||||
| 'cs'
|
||||
| 'css'
|
||||
| 'cxx'
|
||||
| 'erl'
|
||||
| 'f90'
|
||||
| 'f95'
|
||||
| 'f03'
|
||||
| 'f08'
|
||||
| 'f18'
|
||||
| 'fs'
|
||||
| 'fsi'
|
||||
| 'fsx'
|
||||
| 'go'
|
||||
| 'groovy'
|
||||
| 'gs'
|
||||
| 'h'
|
||||
| 'handlebars'
|
||||
| 'hbs'
|
||||
| 'hpp'
|
||||
| 'hr'
|
||||
| 'hs'
|
||||
| 'html'
|
||||
| 'htm'
|
||||
| 'hx'
|
||||
| 'hxx'
|
||||
| 'hy'
|
||||
| 'iced'
|
||||
| 'ily'
|
||||
| 'ino'
|
||||
| 'jade'
|
||||
| 'java'
|
||||
| 'jl'
|
||||
| 'js'
|
||||
| 'jsx'
|
||||
| 'mjs'
|
||||
| 'kt'
|
||||
| 'kts'
|
||||
| 'latex'
|
||||
| 'less'
|
||||
| 'ly'
|
||||
| 'lua'
|
||||
| 'ls'
|
||||
| 'ml'
|
||||
| 'mli'
|
||||
| 'mochi'
|
||||
| 'monkey'
|
||||
| 'mustache'
|
||||
| 'nix'
|
||||
| 'nim'
|
||||
| 'nut'
|
||||
| 'php'
|
||||
| 'php5'
|
||||
| 'pl'
|
||||
| 'py'
|
||||
| 'r'
|
||||
| 'rb'
|
||||
| 'rkt'
|
||||
| 'rs'
|
||||
| 'sass'
|
||||
| 'scala'
|
||||
| 'scss'
|
||||
| 'sty'
|
||||
| 'styl'
|
||||
| 'svg'
|
||||
| 'sql'
|
||||
| 'swift'
|
||||
| 'tex'
|
||||
| 'ts'
|
||||
| 'tsx'
|
||||
| 'vb'
|
||||
| 'vue'
|
||||
| 'xml'
|
||||
| 'yaml'
|
||||
| 'm'
|
||||
| 'mm'
|
||||
| 'bsl';
|
||||
|
||||
type Key = 'total' | 'source' | 'comment' | 'single' | 'block' | 'mixed' | 'blockEmpty' | 'empty' | 'todo';
|
||||
}
|
||||
|
||||
export = sloc;
|
||||
7
types/sloc/sloc-tests.ts
Normal file
7
types/sloc/sloc-tests.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import sloc = require('sloc');
|
||||
|
||||
const stats = sloc('const a = 1;\nconsole.log(a);', 'js');
|
||||
const statsDebugged = sloc('const a = 1;\nconsole.log(a);', 'ts', { debug: true });
|
||||
|
||||
const keys = sloc.keys;
|
||||
const extensions = sloc.extensions;
|
||||
23
types/sloc/tsconfig.json
Normal file
23
types/sloc/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",
|
||||
"sloc-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/sloc/tslint.json
Normal file
1
types/sloc/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user