Skip to content

Commit

Permalink
Update types
Browse files Browse the repository at this point in the history
  • Loading branch information
vshia authored Oct 11, 2021
1 parent 1edb4ac commit b4c7b94
Showing 1 changed file with 29 additions and 31 deletions.
60 changes: 29 additions & 31 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,36 @@
// Definitions by: Niklas Mollenhauer <https://github.com/nikeee>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare namespace humps {

function camelize(value: string): string;
function pascalize(value: string): string;
function decamelize(value: string, optionsOrProcessor?: OptionOrProcessor): string;
function depascalize(value: string, optionsOrProcessor?: OptionOrProcessor): string;
declare module "@humandx/humps" {
declare namespace humps {
function camelize(value: string): string;
function pascalize(value: string): string;
function decamelize(value: string, optionsOrProcessor?: OptionOrProcessor): string;
function depascalize(value: string, optionsOrProcessor?: OptionOrProcessor): string;

function camelizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object;
function pascalizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object;
function decamelizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object;
function depascalizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object;
function camelizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object;
function pascalizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object;
function decamelizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object;
function depascalizeKeys(str: Object, optionsOrProcessor?: OptionOrProcessor): Object;

function camelizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[];
function pascalizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[];
function decamelizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[];
function depascalizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[];
function camelizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[];
function pascalizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[];
function decamelizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[];
function depascalizeKeys(str: Object[], optionsOrProcessor?: OptionOrProcessor): Object[];

interface HumpsOptions {
separator?: string;
split?: RegExp;
process?: HumpsProcessor;
ignorePrivate?: boolean;
}
interface HumpsProcessor {
(key: string, convert: HumpsProcessorParameter, options?: HumpsOptions): string;
}
interface HumpsProcessorParameter {
(key: string, options?: HumpsOptions): string;
}
type OptionOrProcessor = HumpsOptions | HumpsProcessor;
}

declare module "@humandx/humps" {
export = humps;
interface HumpsOptions {
separator?: string;
split?: RegExp;
process?: HumpsProcessor;
ignorePrivate?: boolean;
}
interface HumpsProcessor {
(key: string, convert: HumpsProcessorParameter, options?: HumpsOptions): string;
}
interface HumpsProcessorParameter {
(key: string, options?: HumpsOptions): string;
}
type OptionOrProcessor = HumpsOptions | HumpsProcessor;
}
export = humps;
}

0 comments on commit b4c7b94

Please sign in to comment.