@desci-labs/frontend-components
Version:
A library for commonly used components on the DeSci Frontend web apps
399 lines • 8.98 kB
TypeScript
import { ResearchObjectComponentAnnotation, HighlightBlock } from '@desci-labs/desci-models';
import { IHighlight, ScaledPosition } from 'react-pdf-highlighter';
export interface ScoreGenResult {
UploadedFileName: string;
status: "SUCCEEDED" | "RUNNING" | "FAILED";
result: {
predictions: {
content: {
novelty_score: number;
percentile: number;
};
context: {
novelty_score: number;
percentile: number;
};
};
info: string;
};
modelVersion?: string;
apiVersion?: string;
concepts?: {
concept_ids: string[];
concept_scores: number[];
concept_names: string[];
};
topics?: {
topic_ids: string[];
topic_scores: number[];
topic_names: string[];
};
references?: {
work_ids: string[];
source_ids: string[];
source_names: string[];
source_scores: number[];
};
error?: string;
}
export interface ArticleMatches {
recommendations: {
work_id: string;
score: number;
pub_year: number;
doi?: string;
display_name: string;
authors: string[];
publication_date: string;
journal: string;
}[];
}
export type ClaimAnnotation = {
id: number;
type: "COMMENT" | "HIGHLIGHT";
body: string;
authorId: number;
nodeAttestationId?: number | null;
highlights: HighlightBlock[] | unknown;
links: string[];
uuid?: string;
visible?: boolean;
replyToId?: number | null;
};
export type NodeAttestation = {
id: number;
attestationId: number;
attestationVersionId: number;
desciCommunityId: number;
claimedById: number;
nodeDpid10?: string | undefined;
nodeUuid: string;
nodeVersion: number;
claimedAt: string;
};
export type ClaimComment = ClaimAnnotation & {
meta?: {
upvotes: number;
downvotes: number;
isDownVoted: boolean;
isUpvoted: boolean;
replyCount: number;
};
author: {
id: number;
name: string;
orcid: string | null;
};
attestation?: NodeAttestation & {
attestationVersion: {
name: string;
description: string;
image_url: string;
createdAt: string;
};
} | null;
createdAt?: string;
updatedAt?: string;
};
export interface DraftAnnotation {
is_added?: boolean;
is_new?: boolean;
is_deleted?: boolean;
original_id?: string;
is_updated?: boolean;
}
export interface HiglightAnnotation extends IHighlight, DraftAnnotation {
content: {
text?: string;
image?: string;
};
position: ScaledPosition;
comment: {
text: string;
emoji: string;
};
path?: string;
}
export interface CodeAnnotation extends ResearchObjectComponentAnnotation {
path: string;
text?: string;
cid: string;
startLine: number;
endLine: number;
language: string;
}
export declare enum Viewer {
NONE = "none",
CODE = "code",
VSCODE = "vscode",
JUPYTER = "jupyter",
PDF = "pdf",
IMAGE = "image",
VIDEO = "video",
UPLOAD = "upload"
}
export declare const PDF_EXTENSIONS: {
".pdf": Viewer;
};
export declare const CODE_EXTENSIONS: {
".adoc": Viewer;
".ahk": Viewer;
".aj": Viewer;
".api": Viewer;
".arc": Viewer;
".as": Viewer;
".asax": Viewer;
".asciidoc": Viewer;
".ascx": Viewer;
".ashx": Viewer;
".asmx": Viewer;
".asp": Viewer;
".aspx": Viewer;
".asx": Viewer;
".au3": Viewer;
".axd": Viewer;
".azcli": Viewer;
".bas": Viewer;
".bashrc": Viewer;
".bat": Viewer;
".bazel": Viewer;
".bazelrc": Viewer;
".brs": Viewer;
".bs": Viewer;
".bzl": Viewer;
".c": Viewer;
".c++": Viewer;
".cake": Viewer;
".cc": Viewer;
".cd": Viewer;
".ced": Viewer;
".cfc": Viewer;
".cfg": Viewer;
".cfm": Viewer;
".cfml": Viewer;
".cjs": Viewer;
".cls": Viewer;
".coffee": Viewer;
".conf": Viewer;
".cp": Viewer;
".cpp": Viewer;
".cppm": Viewer;
".cr": Viewer;
".crt": Viewer;
".cs": Viewer;
".csproj": Viewer;
".css": Viewer;
".csv": Viewer;
".cxx": Viewer;
".dart": Viewer;
".def": Viewer;
".dockerfile": Viewer;
".dockerignore": Viewer;
".eex": Viewer;
".elm": Viewer;
".erl": Viewer;
".eslintignore": Viewer;
".ex": Viewer;
".exs": Viewer;
".feature": Viewer;
".fits": Viewer;
".flux": Viewer;
".frm": Viewer;
".frx": Viewer;
".fs": Viewer;
".fsi": Viewer;
".fsscript": Viewer;
".fsx": Viewer;
".gitignore": Viewer;
".go": Viewer;
".gql": Viewer;
".graphql": Viewer;
".graphqlconfig": Viewer;
".graphqls": Viewer;
".groovy": Viewer;
".gs": Viewer;
".h": Viewer;
".h++": Viewer;
".hh": Viewer;
".hpp": Viewer;
".hrl": Viewer;
".htaccess": Viewer;
".html": Viewer;
".htpasswd": Viewer;
".huskyignore": Viewer;
".hxx": Viewer;
".i": Viewer;
".ii": Viewer;
".il": Viewer;
".imba": Viewer;
".in": Viewer;
".ini": Viewer;
".inl": Viewer;
".ino": Viewer;
".ipp": Viewer;
".ipynb": Viewer;
".ixx": Viewer;
".jade": Viewer;
".jake": Viewer;
".java": Viewer;
".jl": Viewer;
".js": Viewer;
".jscsrc": Viewer;
".jshintrc": Viewer;
".json": Viewer;
".jsx": Viewer;
".jxl": Viewer;
".key": Viewer;
".kit": Viewer;
".kt": Viewer;
".ktm": Viewer;
".kts": Viewer;
".leex": Viewer;
".less": Viewer;
".litjson": Viewer;
".log": Viewer;
".lua": Viewer;
".m": Viewer;
".matlab": Viewer;
".md": Viewer;
".mi": Viewer;
".mjml": Viewer;
".mjs": Viewer;
".ml": Viewer;
".mli": Viewer;
".mm": Viewer;
".mo": Viewer;
".nim": Viewer;
".nix": Viewer;
".njk": Viewer;
".npmignore": Viewer;
".nuspec": Viewer;
".octave": Viewer;
".odin": Viewer;
".p8.png": Viewer;
".p8": Viewer;
".paket": Viewer;
".pde": Viewer;
".pem": Viewer;
".perl": Viewer;
".php": Viewer;
".pl": Viewer;
".po": Viewer;
".pot": Viewer;
".pp": Viewer;
".prettierignore": Viewer;
".proj": Viewer;
".prop": Viewer;
".properties": Viewer;
".props": Viewer;
".ps1": Viewer;
".ps1xml": Viewer;
".psc1": Viewer;
".psd1": Viewer;
".psm1": Viewer;
".psmdcp": Viewer;
".pssc": Viewer;
".pubxml.user": Viewer;
".pubxml": Viewer;
".pug": Viewer;
".purs": Viewer;
".py": Viewer;
".r": Viewer;
".raml": Viewer;
".rb": Viewer;
".rego": Viewer;
".rs": Viewer;
".rst": Viewer;
".ruleset": Viewer;
".s": Viewer;
".sc": Viewer;
".scala": Viewer;
".scss": Viewer;
".sfproj": Viewer;
".sh": Viewer;
".sln": Viewer;
".sma": Viewer;
".snippets": Viewer;
".sol": Viewer;
".soy": Viewer;
".sql": Viewer;
".star": Viewer;
".styl": Viewer;
".sv": Viewer;
".svelte": Viewer;
".svh": Viewer;
".swift": Viewer;
".targets": Viewer;
".tcc": Viewer;
".tcl": Viewer;
".terraformrc": Viewer;
".tex": Viewer;
".tf.json": Viewer;
".tf": Viewer;
".tfrc": Viewer;
".tfstate": Viewer;
".tfvars": Viewer;
".tmLanguage": Viewer;
".tmPreferences": Viewer;
".tmTheme": Viewer;
".toml": Viewer;
".tpl": Viewer;
".ts": Viewer;
".tsx": Viewer;
".twig": Viewer;
".txt": Viewer;
".txx": Viewer;
".v": Viewer;
".vagrantfile": Viewer;
".vb": Viewer;
".vba": Viewer;
".vbproj": Viewer;
".vbs": Viewer;
".vbscript": Viewer;
".vcxproj": Viewer;
".vhd": Viewer;
".vhdl": Viewer;
".vsixmanifest": Viewer;
".vspscc": Viewer;
".vssettings": Viewer;
".vssscc": Viewer;
".vstemplate": Viewer;
".vue": Viewer;
".webmanifest": Viewer;
".wixlib": Viewer;
".wixobj": Viewer;
".wixpdb": Viewer;
".wixproj": Viewer;
".wsf": Viewer;
".wx": Viewer;
".wxi": Viewer;
".wxl": Viewer;
".wxs": Viewer;
".xaml": Viewer;
".xh": Viewer;
".xml": Viewer;
".xs": Viewer;
".xunit.runner.json": Viewer;
".xunit": Viewer;
".yaml-tmlanguage": Viewer;
".yaml": Viewer;
".yaws": Viewer;
".yml-tmlanguage": Viewer;
".yml": Viewer;
};
export declare const MEDIA_EXTENSIONS: {
".apng": Viewer;
".bmp": Viewer;
".gif": Viewer;
".jpeg": Viewer;
".jpg": Viewer;
".mov": Viewer;
".mp4": Viewer;
".png": Viewer;
".svg": Viewer;
".webm": Viewer;
".webp": Viewer;
".avif": Viewer;
};
export declare const EXTENSION_MAP: Record<string, Viewer>;
//# sourceMappingURL=interfaces.d.ts.map