Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript .d.ts type definitions improvement #5767

Merged
merged 50 commits into from Feb 18, 2019
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
8660b12
Added type aliases and refined types for Core, cellTypes, and _editors
aaronbeall Jan 16, 2019
1c489fb
Improved GridSettings, added TODOs
aaronbeall Jan 19, 2019
a6ba670
Refined GridSettings into GridSettings -> ColumnSettings -> CellMeta
aaronbeall Jan 23, 2019
a88c3b2
Added validators, missing renderers and editors, and this types
aaronbeall Jan 23, 2019
ef1eb65
Renamed _editors to editors
aaronbeall Jan 23, 2019
fc1de62
Misc refactoring
aaronbeall Jan 24, 2019
451e64d
Removed TODOs
aaronbeall Jan 24, 2019
3844146
Added datePickerConfig: PikadayOptions
aaronbeall Jan 24, 2019
08301bd
Refactored Hooks into Events and Hooks
aaronbeall Jan 24, 2019
0ac72b0
Cleanup and fix comments plugin config
aaronbeall Jan 24, 2019
b21577a
Renamed CellMeta to CellProperties, added licenseKey prop
aaronbeall Jan 24, 2019
b374d84
get and register methods for cell types
aaronbeall Jan 26, 2019
ac94024
get/register methods for validators
aaronbeall Jan 26, 2019
66dd4cc
Fixed Endpoint type
aaronbeall Jan 26, 2019
5c9f9b3
Improved contextMenu types, CellProperties type
aaronbeall Jan 29, 2019
8a33b43
Improved typing of Events
aaronbeall Jan 29, 2019
7037824
abstract BaseEditor and move CommentEditor
aaronbeall Jan 29, 2019
ff6a4c6
Added Omit<> for backwards compatibilty, semi-colon consistency
aaronbeall Jan 29, 2019
7116e66
Merge branch 'develop' into dts-improvements
aaronbeall Jan 30, 2019
8109b52
Refined Element and Event types
aaronbeall Jan 30, 2019
a67df8c
Type arg improvements to meta functions
aaronbeall Jan 30, 2019
8f8f645
Minor fixes
aaronbeall Jan 30, 2019
2c389f8
Improvements to cell meta types
aaronbeall Jan 30, 2019
990eb5d
Fixed event callback return types
aaronbeall Feb 5, 2019
af35705
Reverted back to using _editors to avoid circular name reference
aaronbeall Feb 5, 2019
279e6db
Fixed type tests
aaronbeall Feb 5, 2019
df9e6fa
Removed missing setting
aaronbeall Feb 5, 2019
6cdfc2f
Added missing type tests
aaronbeall Feb 5, 2019
1388bd8
Enabled --strict type checking
aaronbeall Feb 5, 2019
fe44681
Improve types and tests for top-level editors, renderers, and editors
aaronbeall Feb 6, 2019
f00b08d
Merge branch 'develop' into dts-improvements
aaronbeall Feb 6, 2019
9ce1f2f
Added missing settings
aaronbeall Feb 6, 2019
edfd026
Delete generated typers
aaronbeall Feb 6, 2019
7732f79
Doc
aaronbeall Feb 6, 2019
ccb5d5d
Added missing settings to tests
aaronbeall Feb 6, 2019
de634d9
Doc fix
aaronbeall Feb 6, 2019
20cb4fc
BaseEditor type improvement
aaronbeall Feb 6, 2019
81f6ef4
Minor fixes
aaronbeall Feb 7, 2019
fd45347
Added NestedRows.collapsingUI object
aaronbeall Feb 7, 2019
0238e8f
Added issing Handsontable.EventManager
aaronbeall Feb 7, 2019
6a70e87
Improved tests, updated TS to use tuple rest arg in testing
aaronbeall Feb 8, 2019
22238bc
Rename params to be consistent with docs
aaronbeall Feb 8, 2019
0ff3aa8
Overloads for stricter oneOf(), eliminates need for most enums
aaronbeall Feb 8, 2019
a984012
Doc
aaronbeall Feb 8, 2019
fb0a10b
Rename
aaronbeall Feb 8, 2019
707e922
Simpler way to achieve oneOf()
aaronbeall Feb 12, 2019
528e0a9
Remove unused code
aaronbeall Feb 12, 2019
5a02fb7
Core methods test improvement
aaronbeall Feb 12, 2019
6e9ee72
Moved Events into Hooks.Events
aaronbeall Feb 15, 2019
dc5405c
Move Hooks into Hooks.Methods
aaronbeall Feb 15, 2019
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+139 −126
Diff settings

Always

Just for now

Merge branch 'develop' into dts-improvements

# Conflicts:
#	handsontable.d.ts
  • Loading branch information...
aaronbeall committed Jan 30, 2019
commit 7116e666a4cfbe597c226572dd646c250db6a906
Copy path View file
@@ -789,6 +789,7 @@ declare namespace Handsontable {
editor: HTMLElement;
editorStyle: CSSStyleDeclaration;
hidden: boolean;
rootDocument: Document;

setPosition(x: number, y: number): void;
setSize(width: number, height: number): void;
@@ -1719,6 +1720,8 @@ declare namespace Handsontable {
afterGetColumnHeaderRenderers?: (renderers: ((col: number, TH: Element) => void)[]) => void;
afterGetRowHeader?: (row: number, TH: Element) => void;
afterGetRowHeaderRenderers?: (renderers: ((row: number, TH: Element) => void)[]) => void;
afterHideColumns?: (currentHideConfig: number[], destinationHideConfig: number[], actionPossible: boolean, stateChanged: boolean) => void;
afterHideRows?: (currentHideConfig: number[], destinationHideConfig: number[], actionPossible: boolean, stateChanged: boolean) => void;
afterInit?: () => void;
afterLanguageChange?: (languageCode: string) => void;
afterListen?: () => void;
@@ -1753,13 +1756,13 @@ declare namespace Handsontable {
afterSetCellMeta?: (row: number, col: number, key: string, value: any) => void;
afterSetDataAtCell?: (changes: CellChange[], source?: ChangeSource) => void;
afterSetDataAtRowProp?: (changes: CellChange[], source?: ChangeSource) => void;
afterTrimRow?: (rows: number[]) => void;
afterTrimRow?: (currentTrimConfig: number[], destinationTrimConfig: number[], actionPossible: boolean, stateChanged: boolean) => void;
afterUndo?: (action: plugins.UndoRedoAction) => void;
afterUnlisten?: () => void;
afterUnhideColumns?: (currentHideConfig: number[], destinationHideConfig: number[], actionPossible: boolean, stateChanged: boolean) => void;
afterUnhideRows?: (currentHideConfig: number[], destinationHideConfig: number[], actionPossible: boolean, stateChanged: boolean) => void;
afterUnmergeCells?: (cellRange: wot.CellRange, auto: boolean) => void;
afterUntrimRow?: (rows: number[]) => void;
afterUntrimRow?: (currentTrimConfig: number[], destinationTrimConfig: number[], actionPossible: boolean, stateChanged: boolean) => void;
afterUpdateSettings?: (newSettings: GridSettings) => void;
afterValidate?: (isValid: boolean, value: CellValue, row: number, prop: string | number, source: ChangeSource) => void | boolean;
afterViewportColumnCalculatorOverride?: (calc: ViewportColumnsCalculator) => void;
@@ -1785,6 +1788,8 @@ declare namespace Handsontable {
beforeDropdownMenuShow?: (instance: plugins.DropdownMenu) => void;
beforeFilter?: (formulasStack: plugins.FiltersPlugin.ColumnConditions[]) => void;
beforeGetCellMeta?: (row: number, col: number, cellProperties: CellProperties) => void;
beforeHideColumns?: (currentHideConfig: number[], destinationHideConfig: number[], actionPossible: boolean) => void;
beforeHideRows?: (currentHideConfig: number[], destinationHideConfig: number[], actionPossible: boolean) => void;
beforeInit?: () => void;
beforeInitWalkontable?: (walkontableConfig: object) => void;
beforeKeyDown?: (event: KeyboardEvent) => void;
@@ -1810,8 +1815,12 @@ declare namespace Handsontable {
beforeSetRangeStartOnly?: (coords: wot.CellCoords) => void;
beforeStretchingColumnWidth?: (stretchedWidth: number, column: number) => void;
beforeTouchScroll?: () => void;
beforeTrimRow?: (currentTrimConfig: number[], destinationTrimConfig: number[], actionPossible: boolean) => void;
beforeUndo?: (action: plugins.UndoRedoAction) => void;
beforeUnhideColumns?: (currentHideConfig: number[], destinationHideConfig: number[], actionPossible: boolean) => void;
beforeUnhideRows?: (currentHideConfig: number[], destinationHideConfig: number[], actionPossible: boolean) => void;
beforeUnmergeCells?: (cellRange: wot.CellRange, auto: boolean) => void;
beforeUntrimRow?: (currentTrimConfig: number[], destinationTrimConfig: number[], actionPossible: boolean) => void;
beforeValidate?: (value: CellValue, row: number, prop: string | number, source?: ChangeSource) => void;
beforeValueRender?: (value: CellValue, cellProperties: CellProperties) => void;
construct?: () => void;
@@ -1981,130 +1990,133 @@ declare namespace Handsontable {

interface Helper {
readonly KEY_CODES: {
A: number;
ALT: number;
ARROW_DOWN: number;
ARROW_LEFT: number;
ARROW_RIGHT: number;
ARROW_UP: number;
BACKSPACE: number;
C: number;
CAPS_LOCK: number;
COMMA: number;
COMMAND_LEFT: number;
COMMAND_RIGHT: number;
CONTROL_LEFT: number;
DELETE: number;
END: number;
ENTER: number;
ESCAPE: number;
F1: number;
F2: number;
F3: number;
F4: number;
F5: number;
F6: number;
F7: number;
F8: number;
F9: number;
F10: number;
F11: number;
F12: number;
HOME: number;
INSERT: number;
MOUSE_LEFT: number;
MOUSE_MIDDLE: number;
MOUSE_RIGHT: number;
PAGE_DOWN: number;
PAGE_UP: number;
PERIOD: number;
SHIFT: number;
SPACE: number;
TAB: number;
V: number;
X: number;
};
arrayAvg(array: any[]): number;
arrayEach(array: any[], iteratee: (value: any, index: number, array: any[]) => void): any[];
arrayFilter(array: any[], predicate: (value: any, index: number, array: any[]) => void): any[];
arrayFlatten(array: any[]): any[];
arrayIncludes(array: any[], searchElement: any, fromIndex: number): any[];
arrayMap(array: any[], iteratee: (value: any, index: number, array: any[]) => void): any[];
arrayMax(array: any[]): number;
arrayMin(array: any[]): number;
arrayReduce(array: any[], iteratee: (value: any, index: number, array: any[]) => void, accumulator: any, initFromArray: boolean): any;
arraySum(array: any[]): number;
arrayUnique(array: any[]): any[];
cancelAnimationFrame(id: number): void;
cellMethodLookupFactory(methodName: string, allowUndefined: boolean): void;
clone(object: object): object;
columnFactory(GridSettings: GridSettings, conflictList: any[]): object;
createEmptySpreadsheetData(rows: number, columns: number): any[];
createObjectPropListener(defaultValue?: any, propertyToListen?: string): object;
createSpreadsheetData(rows?: number, columns?: number): any[];
createSpreadsheetObjectData(rows?: number, colCount?: number): any[];
curry(func: () => void): () => void;
curryRight(func: () => void): () => void;
debounce(func: () => void, wait?: number): () => void;
deepClone(obj: object): object;
deepExtend(target: object, extension: object): void;
deepObjectSize(object: object): number;
defineGetter(object: object, property: any, value: any, options: object): void;
duckSchema(object: any[] | object): any[] | object;
endsWith(string: string, needle: string): boolean;
equalsIgnoreCase(...string: string[]): boolean;
extend(target: object, extension: object): void;
extendArray(arr: any[], extension: any[]): void;
getComparisonFunction(language: string, options?: object): any | void;
getNormalizedDate(dateString: string): Date;
getProperty(object: object, name: string): any | void;
getPrototypeOf(obj: object): any | void;
hasCaptionProblem(): boolean | void;
inherit(Child: object, Parent: object): object;
isChrome(): boolean;
isCtrlKey(keyCode: number): boolean;
isDefined(variable: any): boolean;
isEdge(): boolean;
isEmpty(variable: any): boolean;
isFunction(func: any): boolean;
isIE(): boolean;
isIE8(): boolean;
isIE9(): boolean;
isKey(keyCode: number, baseCode: string): boolean;
isMetaKey(keyCode: number): boolean;
isMobileBrowser(): boolean;
isMSBrowser(): boolean;
isNumeric(n: any): boolean;
isObject(obj: any): boolean;
isObjectEqual(object1: object | any[], object2: object | any[]): boolean;
isPercentValue(value: string): boolean;
isPrintableChar(keyCode: number): boolean;
isSafari(): boolean;
isTouchSupported(): boolean;
isUndefined(variable: any): boolean;
isWebComponentSupportedNatively(): boolean;
mixin(Base: object, ...mixins: object[]): object;
objectEach(object: object, iteratee: (value: any, key: any, object: object) => void): object;
padStart(string: string, maxLength: number, fillString?: string): string;
partial(func: () => void, ...params: any[]): () => void;
pipe(...functions: (() => void)[]): () => void;
pivot(arr: any[]): any[];
randomString(): string;
rangeEach(rangeFrom: number, rangeTo: number, iteratee: (index: number) => void): void;
rangeEachReverse(rangeFrom: number, rangeTo: number, iteratee: (index: number) => void): void;
requestAnimationFrame(callback: () => void): number;
spreadsheetColumnIndex(label: string): number;
spreadsheetColumnLabel(index: number): string;
startsWith(string: string, needle: string): boolean;
stringify(value: any): string;
stripTags(string: string): string;
substitute(template: string, variables?: object): string;
throttle(func: () => void, wait?: number): () => void;
throttleAfterHits(func: () => void, wait?: number, hits?: number): () => void;
to2dArray(arr: any[]): void;
toUpperCaseFirst(string: string): string;
translateRowsToColumns(input: any[]): any[];
valueAccordingPercent(value: number, percent: string | number): number;
A: number,
ALT: number,
ARROW_DOWN: number,
ARROW_LEFT: number,
ARROW_RIGHT: number,
ARROW_UP: number,
BACKSPACE: number,
C: number,
CAPS_LOCK: number,
COMMA: number,
COMMAND_LEFT: number,
COMMAND_RIGHT: number,
CONTROL_LEFT: number,
DELETE: number,
END: number,
ENTER: number,
ESCAPE: number,
F1: number,
F2: number,
F3: number,
F4: number,
F5: number,
F6: number,
F7: number,
F8: number,
F9: number,
F10: number,
F11: number,
F12: number,
HOME: number,
INSERT: number,
MOUSE_LEFT: number,
MOUSE_MIDDLE: number,
MOUSE_RIGHT: number,
PAGE_DOWN: number,
PAGE_UP: number,
PERIOD: number,
SHIFT: number,
SPACE: number,
TAB: number,
V: number,
X: number
},
arrayAvg(array: any[]): number,
arrayEach(array: any[], iteratee: (value: any, index: number, array: any[]) => void): any[],
arrayFilter(array: any[], predicate: (value: any, index: number, array: any[]) => void): any[],
arrayFlatten(array: any[]): any[],
arrayIncludes(array: any[], searchElement: any, fromIndex: number): any[],
arrayMap(array: any[], iteratee: (value: any, index: number, array: any[]) => void): any[],
arrayMax(array: any[]): number,
arrayMin(array: any[]): number,
arrayReduce(array: any[], iteratee: (value: any, index: number, array: any[]) => void, accumulator: any, initFromArray: boolean): any,
arraySum(array: any[]): number,
arrayUnique(array: any[]): any[],
cancelAnimationFrame(id: number): void,
cellMethodLookupFactory(methodName: string, allowUndefined: boolean): void,
clone(object: object): object,
columnFactory(GridSettings: GridSettings, conflictList: any[]): object,
createEmptySpreadsheetData(rows: number, columns: number): any[],
createObjectPropListener(defaultValue?: any, propertyToListen?: string): object,
createSpreadsheetData(rows?: number, columns?: number): any[],
createSpreadsheetObjectData(rows?: number, colCount?: number): any[],
curry(func: () => void): () => void,
curryRight(func: () => void): () => void,
debounce(func: () => void, wait?: number): () => void,
deepClone(obj: object): object,
deepExtend(target: object, extension: object): void,
deepObjectSize(object: object): number,
defineGetter(object: object, property: any, value: any, options: object): void,
duckSchema(object: any[] | object): any[] | object,
endsWith(string: string, needle: string): boolean,
equalsIgnoreCase(...string: string[]): boolean,
extend(target: object, extension: object): void,
extendArray(arr: any[], extension: any[]): void,
getComparisonFunction(language: string, options?: object): any | void,
getNormalizedDate(dateString: string): Date,
getProperty(object: object, name: string): any | void,
getPrototypeOf(obj: object): any | void,
hasCaptionProblem(): boolean | void,
inherit(Child: object, Parent: object): object,
isChrome(): boolean,
isClassListSupported(): boolean;
isCtrlKey(keyCode: number): boolean,
isDefined(variable: any): boolean,
isEdge(): boolean,
isEmpty(variable: any): boolean,
isFunction(func: any): boolean,
isGetComputedStyleSupported(): boolean,
isIE(): boolean,
isIE8(): boolean,
isIE9(): boolean,
isKey(keyCode: number, baseCode: string): boolean
isMetaKey(keyCode: number): boolean,
isMobileBrowser(): boolean,
isMSBrowser(): boolean,
isNumeric(n: any): boolean,
isObject(obj: any): boolean,
isObjectEqual(object1: object | any[], object2: object | any[]): boolean,
isPercentValue(value: string): boolean,
isPrintableChar(keyCode: number): boolean,
isSafari(): boolean,
isTextContentSupported(): boolean,
isTouchSupported(): boolean,
isUndefined(variable: any): boolean,
isWebComponentSupportedNatively(): boolean,
mixin(Base: object, ...mixins: object[]): object,
objectEach(object: object, iteratee: (value: any, key: any, object: object) => void): object,
padStart(string: string, maxLength: number, fillString?: string): string,
partial(func: () => void, ...params: any[]): () => void,
pipe(...functions: (() => void)[]): () => void,
pivot(arr: any[]): any[],
randomString(): string,
rangeEach(rangeFrom: number, rangeTo: number, iteratee: (index: number) => void): void,
rangeEachReverse(rangeFrom: number, rangeTo: number, iteratee: (index: number) => void): void,
requestAnimationFrame(callback: () => void): number,
spreadsheetColumnIndex(label: string): number,
spreadsheetColumnLabel(index: number): string,
startsWith(string: string, needle: string): boolean,
stringify(value: any): string,
stripTags(string: string): string,
substitute(template: string, variables?: object): string,
throttle(func: () => void, wait?: number): () => void,
throttleAfterHits(func: () => void, wait?: number, hits?: number): () => void,
to2dArray(arr: any[]): void,
toUpperCaseFirst(string: string): string,
translateRowsToColumns(input: any[]): any[],
valueAccordingPercent(value: number, percent: string | number): number
}

interface Dom {
@@ -2233,6 +2245,7 @@ declare namespace Handsontable {
nestedHeaders: plugins.NestedHeaders;
nestedRows: plugins.NestedRows;
observeChanges: plugins.ObserveChanges;
persistentState: plugins.PersistenState;
search: plugins.Search;
touchScroll: plugins.TouchScroll;
trimRows: plugins.TrimRows;
You are viewing a condensed version of this merge commit. You can view the full changes here.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.