Skip to content
On this page

WebpagesView Types

CreateViewRequest

ts
interface CreateViewRequest {
  /**
   * title of the view
   */
  title: string;
  /**
   * description of the view
   */
  description?: string;
  /**
   * webpages sort order
   */
  sort?: WebpagesViewSortOrder;
  /**
   * displayed webpages count
   */
  limit?: number;
  /**
   * enabled limit
   */
  enableLimit?: boolean;
  filters?: WebpagesViewFilter[];
  match?: WebpagesViewFilterMatchRule;
}

WebpagesView

ts
interface WebpagesView {
  id: string;
  title: string;

  description?: string;

  enableLimit: boolean;

  limit: number;

  sort: WebpagesViewSortOrder;

  filters?: WithId<WebpagesViewFilter>[];

  createdAt: number;
}

WebpagesViewFilterMatchRule

ts
type WebpagesViewFilterMatchRule = "and" | "or";

WebpagesViewFilterType

ts
enum WebpagesViewFilterType {
  constant = 0,
  select = 1,
  multiple_selection = 2,
}

WebpagesViewFilter

ts
type WebpagesViewFilter =
  | {
      type: WebpagesViewFilterType.multiple_selection;
      key: "host";
      operator: boolean;
      rightOperand: string[];
    }
  | {
      type: WebpagesViewFilterType.constant;
      key: "liked";
      operator: boolean;
    }
  | {
      type: WebpagesViewFilterType.select;
      key: "annotation";
      operator: AnnotationFilterOperator.is;
      rightOperand: number;
    }
  | {
      type: WebpagesViewFilterType.select;
      key: "first-add-time";
      operator: FirstAddTimeFilterOperator.before;
      rightOperand: FirstAddTimeFilterRightOperands;
    }
  | {
      type: WebpagesViewFilterType.constant;
      key: "link-duplicate";
      operator: boolean;
    }
  | {
      type: WebpagesViewFilterType.constant;
      key: "title-duplicate";
      operator: boolean;
    };

PatchWebpagesViewRequest

ts
interface PatchWebpagesViewRequest {
  title?: string;
  description?: string;
  sort?: WebpagesViewSortOrder;
  limit?: number;
  enableLimit?: boolean;
  match?: WebpagesViewFilterMatchRule;
}