UNPKG

960 BTypeScriptView Raw
1/**
2 * This file has been duplicated in packages/linking-platform/link-picker/src/common/utils/url.ts
3 * Any changes made here should be mirrored there.
4 */
5import LinkifyIt from 'linkify-it';
6/**
7 * Please notify the Editor Mobile team (Slack: #help-mobilekit) if the logic for this changes.
8 */
9export declare const isSafeUrl: (url: string) => boolean;
10export interface Match {
11 schema: any;
12 index: number;
13 lastIndex: number;
14 raw: string;
15 text: string;
16 url: string;
17 length?: number;
18 input?: string;
19}
20export declare const linkify: LinkifyIt.LinkifyIt;
21export declare const LINK_REGEXP: RegExp;
22export declare const linkifyMatch: (text: string) => Match[];
23export declare function getLinkMatch(str?: string): Match | null;
24/**
25 * Adds protocol to url if needed.
26 */
27export declare function normalizeUrl(url?: string): string;
28/**
29 * checks if root relative link
30 */
31export declare function isRootRelative(url: string): boolean;