UNPKG

@egjs/grid

Version:

A component that can arrange items according to the type of grids

46 lines (45 loc) 2.1 kB
/** * egjs-grid * Copyright (c) 2021-present NAVER Corp. * MIT license */ import Grid from "./Grid"; import { GRID_PROPERTY_TYPES } from "./consts"; import { GridItem } from "./GridItem"; import { ResizeWatcherEntry } from "./ResizeWatcher"; export declare function getKeys<T extends Record<string, any>>(obj: T): Array<keyof T>; export declare function getUpdatedItems(items: GridItem[], entries: ResizeWatcherEntry[]): GridItem[]; export declare function getMountedItems(items: GridItem[]): GridItem[]; export declare function getMountedElements(items: GridItem[]): HTMLElement[]; export declare function isString(val: any): val is string; export declare function isObject(val: any): val is object; export declare function isFunction(val: any): val is Function; export declare function isNumber(val: any): val is number; export declare function camelize(str: string): string; export declare function sum(arr: number[]): number; export declare function getDataAttributes(element: HTMLElement, attributePrefix: string): Record<string, string>; export declare function GetterSetter(component: { prototype: Grid<any>; propertyTypes: typeof GRID_PROPERTY_TYPES; }): void; export declare function withMethods(methods: readonly string[]): (prototype: any, memberName: string) => void; export declare function range(length: number): number[]; export declare function getRangeCost(value: number, valueRange: number[]): number; export declare function between(value: number, min: number, max: number): number; export declare function throttle(num: number, unit?: number): number; /** * Decorator that makes the method of grid available in the framework. * @ko 프레임워크에서 그리드의 메소드를 사용할 수 있게 하는 데코레이터. * @memberof eg.Grid * @private * @example * ```js * import { withGridMethods } from "@egjs/grid"; * * class Grid extends React.Component<Partial<GridProps & GridOptions>> { * &#64;withGridMethods * private grid: NativeGrid; * } * ``` */ export declare const withGridMethods: (prototype: any, memberName: string) => void;