UNPKG

@odoo/o-spreadsheet

Version:
32 lines (31 loc) 1.42 kB
import { Registry } from "../registries/registry"; import { CellValue } from "../types/cells"; import { CoreGetters } from "../types/core_getters"; import { Link } from "../types/misc"; import { SpreadsheetChildEnv } from "../types/spreadsheet_env"; /** * Add the `https` prefix to the url if it's missing */ export declare function withHttps(url: string): string; export interface LinkSpec { readonly match: (url: string) => boolean; readonly createLink: (url: string, label: string) => Link; /** * String used to display the URL in components. * Particularly useful for special links (sheet, etc.) * - a simple web link displays the raw url * - a link to a sheet displays the sheet name */ readonly urlRepresentation: (url: string, getters: CoreGetters) => string; readonly open: (url: string, env: SpreadsheetChildEnv, isMiddleClick?: boolean) => void; readonly sequence: number; readonly title: string; readonly icon?: string; readonly getLinkProposals?: (env: SpreadsheetChildEnv) => (Link & { icon: string; })[]; } export declare const urlRegistry: Registry<LinkSpec>; export declare function urlRepresentation(link: Link, getters: CoreGetters): string; export declare function openLink(link: Link, env: SpreadsheetChildEnv, isMiddleClick?: boolean): void; export declare function detectLink(value: CellValue | null): Link | undefined;