mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
feat(karma-json-preprocessor): new type definition (#42738)
- type definitions - tests https://github.com/mjeanroy/karma-json-preprocessor#configuration Thanks!
This commit is contained in:
parent
270c15f15c
commit
29f196223f
31
types/karma-json-preprocessor/index.d.ts
vendored
Normal file
31
types/karma-json-preprocessor/index.d.ts
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
// Type definitions for karma-json-preprocessor 0.3
|
||||
// Project: https://github.com/mjeanroy/karma-json-preprocessor#readme
|
||||
// Definitions by: Piotr Błażejewicz (Peter Blazejewicz) <https://github.com/peterblazejewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.2
|
||||
|
||||
import 'karma';
|
||||
|
||||
declare module 'karma' {
|
||||
interface ConfigOptions {
|
||||
/**
|
||||
* see {@link https://github.com/mjeanroy/karma-json-preprocessor#configuration-1}
|
||||
*/
|
||||
jsonPreprocessor?: JsonPreprocessorOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default global variable name is by default `__json__`,
|
||||
* but you can override it with your own name in karma configuration:
|
||||
*/
|
||||
interface JsonPreprocessorOptions {
|
||||
/**
|
||||
* @default '__json__'
|
||||
*/
|
||||
varName?: string;
|
||||
/**
|
||||
* @default ''
|
||||
*/
|
||||
stripPrefix?: string;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
import karma = require('karma');
|
||||
|
||||
// Mocha reporter options tests
|
||||
const mochaReporter: karma.JsonPreprocessorOptions = {
|
||||
varName: '$json',
|
||||
stripPrefix: 'prefix',
|
||||
};
|
||||
|
||||
module.exports = (config: karma.Config) => {
|
||||
config.set({
|
||||
preprocessors: {
|
||||
'**/*.json': ['json'],
|
||||
},
|
||||
files: ['**/*.js', '**/*.json'],
|
||||
jsonPreprocessor: {
|
||||
varName: '$json',
|
||||
stripPrefix: 'prefix',
|
||||
},
|
||||
});
|
||||
};
|
||||
23
types/karma-json-preprocessor/tsconfig.json
Normal file
23
types/karma-json-preprocessor/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",
|
||||
"karma-json-preprocessor-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/karma-json-preprocessor/tslint.json
Normal file
1
types/karma-json-preprocessor/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user