Tidy up link previews types
This commit is contained in:
parent
dd8a2435ea
commit
b7cd0b1bf7
2 changed files with 8 additions and 12 deletions
6
js/modules/link_previews.d.ts
vendored
6
js/modules/link_previews.d.ts
vendored
|
@ -1,3 +1,9 @@
|
||||||
export function isLinkSafeToPreview(link: string): boolean;
|
export function isLinkSafeToPreview(link: string): boolean;
|
||||||
|
|
||||||
|
export function findLinks(text: string, caretLocation?: number): Array<string>;
|
||||||
|
|
||||||
|
export function getDomain(href: string): string;
|
||||||
|
|
||||||
export function isLinkSneaky(link: string): boolean;
|
export function isLinkSneaky(link: string): boolean;
|
||||||
|
|
||||||
|
export function isStickerPack(href: string): boolean;
|
||||||
|
|
14
ts/window.d.ts
vendored
14
ts/window.d.ts
vendored
|
@ -3,6 +3,7 @@
|
||||||
import * as Backbone from 'backbone';
|
import * as Backbone from 'backbone';
|
||||||
import * as Underscore from 'underscore';
|
import * as Underscore from 'underscore';
|
||||||
import { Ref } from 'react';
|
import { Ref } from 'react';
|
||||||
|
import * as LinkPreviews from '../js/modules/link_previews.d';
|
||||||
import * as Util from './util';
|
import * as Util from './util';
|
||||||
import {
|
import {
|
||||||
ConversationModelCollectionType,
|
ConversationModelCollectionType,
|
||||||
|
@ -358,18 +359,7 @@ declare global {
|
||||||
VisualAttachment: any;
|
VisualAttachment: any;
|
||||||
};
|
};
|
||||||
Util: typeof Util;
|
Util: typeof Util;
|
||||||
LinkPreviews: {
|
LinkPreviews: typeof LinkPreviews;
|
||||||
isMediaLinkInWhitelist: any;
|
|
||||||
getTitleMetaTag: any;
|
|
||||||
getImageMetaTag: any;
|
|
||||||
assembleChunks: any;
|
|
||||||
getChunkPattern: any;
|
|
||||||
isLinkInWhitelist: any;
|
|
||||||
isStickerPack: (url: string) => boolean;
|
|
||||||
isLinkSafeToPreview: (url: string) => boolean;
|
|
||||||
findLinks: (body: string, unknown?: any) => Array<string>;
|
|
||||||
getDomain: (url: string) => string;
|
|
||||||
};
|
|
||||||
GroupChange: {
|
GroupChange: {
|
||||||
renderChange: (change: unknown, things: unknown) => Array<string>;
|
renderChange: (change: unknown, things: unknown) => Array<string>;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue