Skip to content
On this page

Webpages Types

UploadWebpageRequest

ts
interface UploadWebpageRequest {
  ext: WebsiteExt;

  content: string;

  title?: string;
  link?: string;
}

Webpage

ts
interface WebpageHighlight {
  highlightId: string;
  type: 1;
  marker: {
    meta: {
      textBefore: string;
      textAfter: string;
    };
  };
  text: string;
}

interface Webpage {
  title: string;
  excerpt: string;
  liked: boolean;
  link?: string;
  ext: WebsiteExt;
  id: string;
  size: number;
  read: boolean;
  highlights: WebpageHighlight[];
  firstAddTime: number;
  createTime: number;
}

WebsiteExt

ts
enum WebsiteExt {
  mhtml = "mhtml",
  webarchive = "webarchive",
  html = "html",
}

WebpagesList

ts
interface WebpagesList {
  webpages: WebPage[];
}

WebpagesSearchOptions

ts
interface WebpagesSearchOptions {
  q: string;

  liked?: boolean;

  read?: boolean;

  annotated?: boolean;

  host?: string | string[];

  ext?: WebsiteExt | WebsiteExt[];
  /**
   * @default 30
   */
  per_page?: number;
  /**
   * @default 1
   */
  page?: number;
}

WebpagesListOptions

ts
interface WebpagesListOptions {
  liked?: boolean;
  read?: boolean;
  annotated?: boolean;
  host?: string | string[];
  ext?: WebsiteExt | WebsiteExt[];
  /**
   * @default 30
   */
  per_page?: number;
  /**
   * @default 1
   */
  page?: number;

  sort?:
    | "title_asc"
    | "title_desc"
    | "first_add_time_asc"
    | "first_add_time_desc"
    | "annotate_count_asc"
    | "annotate_count_desc";
}

PatchWebPageRequest

ts
interface PatchWebPageRequest {
  excerpt?: string;

  title?: string;

  link?: string;

  liked?: boolean;

  read?: boolean;
}