Skip to content

Commit

Permalink
added form-data-json.d.ts for better typescript autocompletion support
Browse files Browse the repository at this point in the history
  • Loading branch information
brainfoolong committed Apr 12, 2024
1 parent 59bbdac commit da6a79c
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 2.2.2 - 2024-04-12

* added form-data-json.d.ts for better typescript autocompletion support (thx to @kurybr - https://github.com/brainfoolong/form-data-json/issues/36)

### 2.2.1 - 2023-08-13

* fixed set checkbox checked with array values on implicit names https://github.com/brainfoolong/form-data-json/issues/35
Expand Down
38 changes: 38 additions & 0 deletions dist/form-data-json.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
declare module 'form-data-json-convert' {
interface OptionsToJson {
includeDisabled?: boolean;
includeButtonValues?: boolean;
uncheckedValue?: any;
inputFilter?: ((inputElement: HTMLInputElement) => boolean) | null;
flatList?: boolean;
skipEmpty?: boolean;
filesCallback?: ((values: any) => void) | null;
fileReaderFunction?: string;
arrayify?: boolean;
}

interface OptionsFromJson {
flatList?: boolean;
clearOthers?: boolean;
resetOthers?: boolean;
triggerChangeEvent?: boolean;
}

function toJson(
form: HTMLFormElement | string | JQuery,
options?: OptionsToJson
): any;

function fromJson(
form: HTMLFormElement | string | JQuery,
values: any,
options?: OptionsFromJson
): void;

function reset(form: HTMLFormElement | string | JQuery): void;

function clear(form: HTMLFormElement | string | JQuery): void;

const defaultOptionsToJson: OptionsToJson;
const defaultOptionsFromJson: OptionsFromJson;
}
2 changes: 1 addition & 1 deletion dist/form-data-json.es6.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// form-data-json-convert | version: 2.2.1 | url: https://github.com/brainfoolong/form-data-json
// form-data-json-convert | version: 2.2.2 | url: https://github.com/brainfoolong/form-data-json
/**
* Form Data Json Converter
* @link https://github.com/brainfoolong/form-data-json
Expand Down
2 changes: 1 addition & 1 deletion dist/form-data-json.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// form-data-json-convert | version: 2.2.1 | url: https://github.com/brainfoolong/form-data-json
// form-data-json-convert | version: 2.2.2 | url: https://github.com/brainfoolong/form-data-json
"use strict";

/**
Expand Down
2 changes: 1 addition & 1 deletion dist/form-data-json.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/scripts/form-data-json.es6.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// form-data-json-convert | version: 2.2.1 | url: https://github.com/brainfoolong/form-data-json
// form-data-json-convert | version: 2.2.2 | url: https://github.com/brainfoolong/form-data-json
/**
* Form Data Json Converter
* @link https://github.com/brainfoolong/form-data-json
Expand Down
2 changes: 1 addition & 1 deletion docs/scripts/form-data-json.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// form-data-json-convert | version: 2.2.1 | url: https://github.com/brainfoolong/form-data-json
// form-data-json-convert | version: 2.2.2 | url: https://github.com/brainfoolong/form-data-json
"use strict";

/**
Expand Down
2 changes: 1 addition & 1 deletion docs/scripts/form-data-json.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "git",
"url": "git+https://github.com/brainfoolong/form-data-json.git"
},
"version": "2.2.1",
"version": "2.2.2",
"scripts": {
"dist": "node build/dist.js"
},
Expand Down

0 comments on commit da6a79c

Please sign in to comment.