Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions types/animation.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Chart } from './index.esm';
import { AnyObject } from './basic';

export class Animation {
constructor(cfg: any, target: any, prop: string, to?: any);
constructor(cfg: AnyObject, target: AnyObject, prop: string, to?: unknown);
active(): boolean;
update(cfg: any, to: any, date: number): void;
update(cfg: AnyObject, to: unknown, date: number): void;
cancel(): void;
tick(date: number): void;
}
Expand All @@ -25,7 +26,7 @@ export class Animator {
}

export class Animations {
constructor(chart: Chart, animations: {});
configure(animations: {}): void;
update(target: any, values: any): undefined | boolean;
constructor(chart: Chart, animations: AnyObject);
configure(animations: AnyObject): void;
update(target: AnyObject, values: AnyObject): undefined | boolean;
}
3 changes: 3 additions & 0 deletions types/basic.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

export type AnyObject = Record<string, unknown>;
export type EmptyObject = Record<string, never>;
22 changes: 12 additions & 10 deletions types/helpers/helpers.core.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { AnyObject } from '../basic';

/**
* An empty function that can be used, for example, for optional callback.
*/
Expand All @@ -15,27 +17,27 @@ export function uid(): number;
* @returns {boolean}
* @since 2.7.0
*/
export function isNullOrUndef(value: any): value is null | undefined;
export function isNullOrUndef(value: unknown): value is null | undefined;
/**
* Returns true if `value` is an array (including typed arrays), else returns false.
* @param {*} value - The value to test.
* @returns {boolean}
* @function
*/
export function isArray<T = any>(value: any): value is ArrayLike<T>;
export function isArray<T = unknown>(value: unknown): value is ArrayLike<T>;
/**
* Returns true if `value` is an object (excluding null), else returns false.
* @param {*} value - The value to test.
* @returns {boolean}
* @since 2.7.0
*/
export function isObject(value: any): value is object;
export function isObject(value: unknown): value is AnyObject;
/**
* Returns true if `value` is a finite number, else returns false
* @param {*} value - The value to test.
* @returns {boolean}
*/
export function isFinite(value: any): value is number;
export function isFinite(value: unknown): value is number;
/**
* Returns `value` if defined, else returns `defaultValue`.
* @param {*} value - The value to return if defined.
Expand All @@ -51,9 +53,9 @@ export function valueOrDefault<T>(value: T | undefined, defaultValue: T): T;
* @param [thisArg] - The value of `this` provided for the call to `fn`.
* @returns {*}
*/
export function callback<T extends (this: TA, ...args: any[]) => R, TA, R>(
export function callback<T extends (this: TA, ...args: unknown[]) => R, TA, R>(
fn: T | undefined,
args: any[],
args: unknown[],
thisArg?: TA
): R | undefined;

Expand Down Expand Up @@ -95,7 +97,7 @@ export function each<T, TA>(
export function clone<T>(source: T): T;

export interface MergeOptions {
merger?: (key: string, target: any, source: any, options: any) => any;
merger?: (key: string, target: AnyObject, source: AnyObject, options: AnyObject) => AnyObject;
}
/**
* Recursively deep copies `source` properties into `target` with the given `options`.
Expand All @@ -116,7 +118,7 @@ export function merge<T, S1, S2, S3, S4>(
source: [S1, S2, S3, S4],
options?: MergeOptions
): T & S1 & S2 & S3 & S4;
export function merge<T>(target: T, source: any[], options?: MergeOptions): any;
export function merge<T>(target: T, source: AnyObject[], options?: MergeOptions): AnyObject;

/**
* Recursively deep copies `source` properties into `target` *only* if not defined in target.
Expand All @@ -131,6 +133,6 @@ export function mergeIf<T, S1>(target: T, source: [S1]): T & S1;
export function mergeIf<T, S1, S2>(target: T, source: [S1, S2]): T & S1 & S2;
export function mergeIf<T, S1, S2, S3>(target: T, source: [S1, S2, S3]): T & S1 & S2 & S3;
export function mergeIf<T, S1, S2, S3, S4>(target: T, source: [S1, S2, S3, S4]): T & S1 & S2 & S3 & S4;
export function mergeIf<T>(target: T, source: any[]): any;
export function mergeIf<T>(target: T, source: AnyObject[]): AnyObject;

export function resolveObjectKey(obj: any, key: string): any;
export function resolveObjectKey(obj: AnyObject, key: string): AnyObject;
Loading