mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
26 lines
402 B
TypeScript
26 lines
402 B
TypeScript
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
|