fix: no overloading
This commit is contained in:
@@ -1,18 +1,13 @@
|
|||||||
import { IframelyErrorResponse, Unfurl } from "@shared/types";
|
import { Unfurl } from "@shared/types";
|
||||||
|
|
||||||
function presentUnfurl(data: any): Unfurl | IframelyErrorResponse {
|
function presentUnfurl(data: any): Unfurl {
|
||||||
return !data.error
|
return {
|
||||||
? {
|
|
||||||
url: data.url,
|
url: data.url,
|
||||||
type: data.type,
|
type: data.type,
|
||||||
title: data.title,
|
title: data.title,
|
||||||
description: data.description,
|
description: data.description,
|
||||||
thumbnailUrl: data.thumbnail_url,
|
thumbnailUrl: data.thumbnail_url,
|
||||||
meta: data.meta,
|
meta: data.meta,
|
||||||
}
|
|
||||||
: {
|
|
||||||
status: data.status,
|
|
||||||
error: data.error,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -225,10 +225,5 @@ export type Unfurl<T = OEmbedType> = {
|
|||||||
meta?: Record<string, string>;
|
meta?: Record<string, string>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type IframelyErrorResponse = {
|
|
||||||
status: number;
|
|
||||||
error: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
export type ProsemirrorData = Record<string, any>;
|
export type ProsemirrorData = Record<string, any>;
|
||||||
|
|||||||
Reference in New Issue
Block a user