Skip to content

Commit 615e77d

Browse files
chore(gh-bot): 🚀 build types, api & library files
1 parent b515c4b commit 615e77d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1397
-325
lines changed

@types/index.d.ts

+79-12
Original file line numberDiff line numberDiff line change
@@ -152,39 +152,106 @@ export declare const SpringOutInFrame: TypeFrameFunction;
152152
* 0 as our start number and 100 as our end number, so, basic interpolation would interpolate between 0 to 100.
153153
154154
* If we use a `t` of 0.5, the interpolated value between 0 to 100, is 50.
155-
* {@link interpolateNumber} takes it further, by allowing you to interpolate with more than 2 values,
155+
* {@link instantNumber} takes it further, by allowing you to interpolate with more than 2 values,
156156
* it allows for multiple values.
157157
* E.g. Given an Array of values [0, 100, 0], and a `t` of 0.5, the interpolated value would become 100.
158158
159159
* Based on d3.interpolateBasis [https://github.com/d3/d3-interpolate#interpolateBasis],
160160
* check out the link above for more detail.
161161
*
162+
* @param t A number between 0 to 1
163+
* @param values Array of numbers to interpolate between
164+
* @param decimal How many decimals should the interpolated value have
165+
* @return Interpolated number at instant `t`
166+
*
167+
* @source Source code of `instantNumber`
168+
*/
169+
export declare function instantNumber(t: number, values: number[], decimal?: number): number;
170+
/**
171+
* Buliding on-top of {@link instantNumber}, `interpolateNumber` interpolates between numbers, but unlike {@link instantNumber}
172+
* `interpolateNumber` uses an Array of `t` instances to generate an array of interpolated values
173+
*
174+
* @param arr_t Array of numbers (between 0 to 1) which each represent an instant of the interpolation
175+
* @param values Array of numbers to interpolate between
176+
* @param decimal How many decimals should the interpolated value have
177+
* @return Array of interpolated numbers at different instances
178+
*
162179
* @source Source code of `interpolateNumber`
163180
*/
164-
export declare function interpolateNumber(frames: number[], values: number[], decimal?: number): number[];
181+
export declare function interpolateNumber(arr_t: number[], values: number[], decimal?: number): number[];
165182
/**
166-
* Given an Array of values, find a value using `t` (`t` goes from 0 to 1), by
183+
* Given an Array of values, find a value using `t` (which goes from 0 to 1), by
167184
* using `t` to estimate the index of said value in the array of `values`
168185
169-
* This is meant for interploating strings that aren't number-like
186+
* This is meant for interplolating strings that aren't number-like
187+
188+
* @param t A number between 0 to 1
189+
* @param values Array of numbers to interpolate between
190+
* @return Interpolated numbers at different instances
170191
171-
* @source Source code of `interpolateUsingIndex`
192+
* @source Source code of `instantSequence`
193+
*/
194+
export declare function instantSequence<T>(t: number, values: T[]): T;
195+
/**
196+
* Given an Array of items, find an item using `t` (which goes from 0 to 1), by
197+
* using `t` to estimate the index of said value in the array of `values`,
198+
* then expand that to encompass multiple `t`'s in an Array,
199+
* which returns Array items which each follow the interpolated index value
200+
201+
* This is meant for interplolating strings that aren't number-like
202+
203+
* @param arr_t Array of numbers (between 0 to 1) which each represent an instant of the interpolation
204+
* @param values Array of items to choose from
205+
* @return Array of Interpolated input Array items at different instances
206+
207+
* @source Source code of `interpolateSequence`
208+
*/
209+
export declare function interpolateSequence<T>(arr_t: number[], values: T[]): T[];
210+
/**
211+
* Alias of {@link instantSequence}
212+
* @deprecated please use {@link instantSequence}, it's the same functionality but different name
213+
*/
214+
export declare const instantUsingIndex: typeof instantSequence;
215+
/**
216+
* Alias of {@link interpolateSequence}
217+
* @deprecated please use {@link interpolateSequence}, it's the same functionality but different name
218+
*/
219+
export declare const interpolateUsingIndex: typeof interpolateSequence;
220+
/**
221+
* Functions the same way {@link instantNumber} works.
222+
* Convert strings to numbers, and then interpolates the numbers,
223+
* at the end if there are units on the first value in the `values` array,
224+
* it will use that unit for the interpolated result.
225+
* Make sure to read {@link instantNumber}.
226+
*
227+
* @source Source code of `instantString`
172228
*/
173-
export declare function interpolateUsingIndex(frames: number[], values: (string | number)[]): (string | number)[];
229+
export declare function instantString(t: number, values: (string | number)[], decimal?: number): string;
174230
/**
175231
* Functions the same way {@link interpolateNumber} works.
176232
* Convert strings to numbers, and then interpolates the numbers,
177233
* at the end if there are units on the first value in the `values` array,
178234
* it will use that unit for the interpolated result.
179235
* Make sure to read {@link interpolateNumber}.
236+
*
237+
* @source Source code of `interpolateString`
238+
*/
239+
export declare function interpolateString(arr_t: number[], values: (string | number)[], decimal?: number): string[];
240+
/**
241+
* Interpolates all types of values including number, and string values.
242+
* Make sure to read {@link instantNumber}, {@link instantString} and {@link instantSequence}.
243+
*
244+
* @source Source code of `instantComplex`
180245
*/
181-
export declare function interpolateString(frames: number[], values: (string | number)[], decimal?: number): string[];
246+
export declare function instantComplex<T>(t: number, values: T[], decimal?: number): string | number | T;
182247
/**
183-
* Interpolates all types of values including number, string, color, and complex values.
184-
* Complex values are values like "10px solid red", that border, and other CSS Properties use.
185-
* Make sure to read {@link interpolateNumber}, and {@link interpolateString}.
248+
* Interpolates all types of values including number, string, etc... values.
249+
* Make sure to read {@link interpolateNumber}, {@link interpolateString} and {@link interpolateSequence},
250+
* as depending on the values given
251+
*
252+
* @source Source code of `interpolateComplex`
186253
*/
187-
export declare function interpolateComplex(frames: number[], values: (string | number)[], decimal?: number): (string | number)[];
254+
export declare function interpolateComplex<T>(arr_t: number[], values: T[], decimal?: number): number[] | string[] | T[];
188255
/**
189256
* The array frame function format for easings,
190257
* @example
@@ -375,5 +442,5 @@ export declare function GenerateSpringFrames(options?: TypeEasingOptions): [numb
375442
* ]
376443
* ```
377444
*/
378-
export declare function SpringEasing(values: (string | number)[], options?: TypeEasingOptions | TypeEasingOptions["easing"], customInterpolate?: TypeInterpolationFunction): [(string | number | any)[], number];
445+
export declare function SpringEasing<T>(values: T[], options?: TypeEasingOptions | TypeEasingOptions["easing"], customInterpolate?: TypeInterpolationFunction): readonly [any[], number];
379446
export default SpringEasing;

docs/assets/custom.css

+4
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ img[src^="https://bundlejs.com/"] {
141141
border: 1px solid rgb(20 20 20 / 0.25);
142142
}
143143

144+
.container {
145+
max-width: 1200px;
146+
}
147+
144148
header.tsd-page-toolbar {
145149
border-bottom: 1px solid var(--color-panel-divider);
146150
}

0 commit comments

Comments
 (0)