UNPKG

@jupyterlab/git

Version:

A JupyterLab extension for version control using git

32 lines (31 loc) 1.49 kB
/// <reference types="react" /> import { CommandRegistry } from '@lumino/commands'; import { Git } from './tokens'; /** Get the filename from a path */ export declare function extractFilename(path: string): string; /** * Click handler that prevents the event from reaching an ancestor. * * @param event Mouse event */ export declare function stopPropagation(event: React.MouseEvent<HTMLElement, MouseEvent>): void; /** * Wrap mouse event handler to stop event propagation * @param fn Mouse event handler * @returns Mouse event handler that stops event from propagating */ export declare function stopPropagationWrapper(fn: (event?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void): (event?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void; export declare function decodeStage(x: string, y: string): Git.Status; /** * Returns a promise which resolves after a specified duration. * * @param ms - duration (in milliseconds) * @returns a promise */ export declare function sleep(ms: number): Promise<void>; /** * A callback function to display a file diff between two commits. * @param commands the command registry. * @returns a callback function to display a file diff. */ export declare const openFileDiff: (commands: CommandRegistry) => (commit: Git.ISingleCommitInfo, previousCommit?: Git.ISingleCommitInfo) => (filePath: string, isText: boolean, previousFilePath?: string) => (event?: React.MouseEvent<HTMLLIElement, MouseEvent>) => Promise<void>;