WebpagesView Types

CreateViewRequest

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

interface WebpagesView {
  id: string;
  title: string;

  description?: string;

  enableLimit: boolean;

  limit: number;

  sort: WebpagesViewSortOrder;

  filters?: WithId<WebpagesViewFilter>[];

  createdAt: number;
}

WebpagesViewFilterMatchRule

type WebpagesViewFilterMatchRule = "and" | "or";

WebpagesViewFilterType

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

WebpagesViewFilter

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

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