mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 08:17:05 +00:00
Add type definition for react-native-navbar (#28746)
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
// Type definitions for react-global-configuration 1.3
|
||||
// Project: https://github.com/morenofa/react-global-configuration#readme
|
||||
// Definitions by: Ryo Kikuchi <https://github.com/ryokik>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
export interface Options {
|
||||
freeze: boolean;
|
||||
assign: boolean;
|
||||
}
|
||||
|
||||
declare namespace ReactGlobalConfiguration {
|
||||
function set(newConfiguration: any, newOptions?: Options): void;
|
||||
function get(key?: string): any;
|
||||
function get<Value = any>(key: string, fallbackValue: Value): Value;
|
||||
function serialize(): string;
|
||||
}
|
||||
|
||||
export default ReactGlobalConfiguration;
|
||||
@@ -0,0 +1,25 @@
|
||||
import config from "react-global-configuration";
|
||||
|
||||
interface UserConfig {
|
||||
a: number;
|
||||
b: string;
|
||||
c: {
|
||||
ca: 123;
|
||||
cb: 'ABC';
|
||||
};
|
||||
}
|
||||
|
||||
config.set({
|
||||
a: 456,
|
||||
b: "DEF",
|
||||
c: {
|
||||
ca: 123,
|
||||
cb: 'ABC',
|
||||
}
|
||||
});
|
||||
|
||||
config.serialize();
|
||||
|
||||
const all = config.get(); // all: any
|
||||
const a = config.get<number>('a', 789); // a: number
|
||||
const d = config.get('d'); // d: any
|
||||
@@ -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",
|
||||
"react-global-configuration-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user