ag-grid-react
Version:
AG Grid React Component
40 lines (39 loc) • 2.25 kB
TypeScript
export declare const classesList: (...list: (string | null | undefined)[]) => string;
export declare class CssClasses {
private classesMap;
constructor(...initialClasses: string[]);
setClass(className: string, on: boolean): CssClasses;
toString(): string;
}
export declare const isComponentStateless: (Component: any) => boolean;
export declare function isReact19(): boolean;
/** Enable flushSync to be disabled for the callback and the next frame (via setTimeout 0) to prevent flushSync during an existing render.
* Provides an alternative to the more fine grained useFlushSync boolean param to agFlushSync.
*/
export declare function runWithoutFlushSync<T>(func: () => T): T;
/**
* Wrapper around flushSync to provide backwards compatibility with React 16-17
* Also allows us to control via the `useFlushSync` param whether we want to use flushSync or not
* as we do not want to use flushSync when we are likely to already be in a render cycle
*/
export declare const agFlushSync: (useFlushSync: boolean, fn: () => void) => void;
/**
* Wrapper around startTransition to provide backwards compatibility with React 16-17
*/
export declare const agStartTransition: (fn: () => void) => void;
/**
* Wrapper around useSyncExternalStore to provide backwards compatibility with React 16-17
*/
export declare function agUseSyncExternalStore<T>(subscribe: (onStoreChange: () => void) => () => void, getSnapshot: () => T, defaultSnapshot: T): T;
/**
* The list to render for `next`, keeping values already rendered in their previous order, so React moves no DOM node
* and CSS transitions survive. Returns `prev` when nothing changed, and `next` when nothing is rendered yet or it
* already has that order, so an unchanged reference skips a render; otherwise builds the kept values in `prev` order
* with the new ones added.
* Each list must hold distinct values.
* @param maintainOrder Follow `next`'s order, as the DOM must for accessibility
* @param placeNewInOrder Put each new value before the kept value that follows it in `next`, not last
*/
export declare function getNextValueIfDifferent<T extends {
diffIndex: number;
}>(prev: T[] | undefined, next: T[], maintainOrder: boolean, placeNewInOrder?: boolean): T[];