Tidy up link previews types

This commit is contained in:
Evan Hahn 2020-10-26 16:20:08 -05:00 committed by Evan Hahn
parent dd8a2435ea
commit b7cd0b1bf7
2 changed files with 8 additions and 12 deletions

View file

@ -1,3 +1,9 @@
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 isStickerPack(href: string): boolean;

14
ts/window.d.ts vendored
View file

@ -3,6 +3,7 @@
import * as Backbone from 'backbone';
import * as Underscore from 'underscore';
import { Ref } from 'react';
import * as LinkPreviews from '../js/modules/link_previews.d';
import * as Util from './util';
import {
ConversationModelCollectionType,
@ -358,18 +359,7 @@ declare global {
VisualAttachment: any;
};
Util: typeof Util;
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;
};
LinkPreviews: typeof LinkPreviews;
GroupChange: {
renderChange: (change: unknown, things: unknown) => Array<string>;
};