diff --git a/src/hono.ts b/src/hono.ts index ee74a2380..cddced48a 100644 --- a/src/hono.ts +++ b/src/hono.ts @@ -807,14 +807,20 @@ declare const entriesOpenAPISchema: z.ZodObject; + width: z.ZodOptional; + height: z.ZodOptional; preview_image_url: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "photo" | "video"; url: string; + width?: number | undefined; + height?: number | undefined; preview_image_url?: string | undefined; }, { type: "photo" | "video"; url: string; + width?: number | undefined; + height?: number | undefined; preview_image_url?: string | undefined; }>, "many">>>; }>, "strip", z.ZodTypeAny, { @@ -834,6 +840,8 @@ declare const entriesOpenAPISchema: z.ZodObject[0]["query"]["language"] export type RecommendationItem = ExtractBizResponse["data"][string] + +export type ActionOperation = + | "contains" + | "not_contains" + | "eq" + | "not_eq" + | "gt" + | "lt" + | "regex" +export type ActionEntryField = "all" | "title" | "content" | "author" | "url" | "order" +export type ActionFeedField = "view" | "title" | "site_url" | "feed_url" | "category" diff --git a/src/renderer/src/modules/settings/action-card.tsx b/src/renderer/src/modules/settings/action-card.tsx index 148b67475..5cc11c5b9 100644 --- a/src/renderer/src/modules/settings/action-card.tsx +++ b/src/renderer/src/modules/settings/action-card.tsx @@ -24,24 +24,13 @@ import { import { ViewSelectContent } from "@renderer/components/view-select-content" import { stopPropagation } from "@renderer/lib/dom" import { cn } from "@renderer/lib/utils" -import type { SupportedLanguages } from "@renderer/models" - -type Operation = - | "contains" - | "not_contains" - | "eq" - | "not_eq" - | "gt" - | "lt" - | "regex" -type EntryField = "all" | "title" | "content" | "author" | "url" | "order" -type FeedField = "view" | "title" | "site_url" | "feed_url" +import type { ActionEntryField, ActionFeedField, ActionOperation, SupportedLanguages } from "@renderer/models" type ActionsInput = { name: string condition: { - field?: FeedField - operator?: Operation + field?: ActionFeedField + operator?: ActionOperation value?: string }[] result: { @@ -52,8 +41,8 @@ type ActionsInput = { to: string }[] blockRules?: { - field?: EntryField - operator?: Operation + field?: ActionEntryField + operator?: ActionOperation value?: string | number }[] } @@ -220,8 +209,8 @@ const OperationTableCell = ({ onValueChange, }: { type: string - value?: Operation - onValueChange?: (value: Operation) => void + value?: ActionOperation + onValueChange?: (value: ActionOperation) => void }) => { const options = OperationOptions.filter((option) => option.types.includes(type), @@ -368,7 +357,7 @@ export function ActionCard({