import type { sheets_v4 } from "@googleapis/sheets"; import type * as z from "zod"; import { BANDED_RANGE_SCHEMA, BANDING_PROPERTIES_SCHEMA, BANDING_PROPERTIES_UPDATE_SCHEMA, BORDERS_SCHEMA, CELL_FORMAT_SCHEMA, CLEAR_FORMAT_PROPERTY_SCHEMA, COLOR_SCHEMA, CONDITIONAL_FORMAT_RULE_INPUT_SCHEMA, TABLE_STYLE_UPDATE_SCHEMA } from "./schemas.js"; /** * Converts a public color into a provider ColorStyle oneof. * * @param color - Public RGB or theme color. */ export declare function toGoogleColorStyle(color: z.infer): sheets_v4.Schema$ColorStyle; /** * Normalizes a provider ColorStyle while rejecting malformed oneofs. * * @param style - Provider RGB or theme color. * @throws When the provider color is malformed or unknown. */ export declare function normalizeGoogleColorStyle(style: sheets_v4.Schema$ColorStyle): z.infer; /** * Builds the exact update mask for clearing selected or all cell formatting. * * @param properties - Public formatting properties, or undefined for all. */ export declare function toGoogleClearFormatFields(properties: z.infer[] | undefined): string; /** * Builds the provider requests for a range-format update. * * @param format - Public cell-format update. * @param range - Resolved provider grid range. */ export declare function toGoogleFormatRequests(format: z.infer, range: sheets_v4.Schema$GridRange): sheets_v4.Schema$Request[]; /** * Builds repeat-cell formatting and its exact relative field-mask paths. * * @param format - Public cell-format update. */ export declare function toGoogleCellFormat(format: z.infer): { fields: string[]; format: { backgroundColorStyle: sheets_v4.Schema$ColorStyle | undefined; horizontalAlignment: string | undefined; hyperlinkDisplayType: string | undefined; numberFormat: { pattern: string | undefined; type: "TEXT" | "CURRENCY" | "DATE" | "DATE_TIME" | "NUMBER" | "PERCENT" | "SCIENTIFIC" | "TIME"; } | undefined; padding: { bottom: number; left: number; right: number; top: number; } | undefined; textDirection: string | undefined; textFormat: { bold: boolean | undefined; fontFamily: string | undefined; fontSize: number | undefined; foregroundColorStyle: sheets_v4.Schema$ColorStyle | undefined; italic: boolean | undefined; link: { uri: string; } | undefined; strikethrough: boolean | undefined; underline: boolean | undefined; } | undefined; textRotation: { angle: number; vertical?: undefined; } | { vertical: boolean; angle?: undefined; } | undefined; verticalAlignment: string | undefined; wrapStrategy: string | undefined; }; }; /** * Builds a provider range-border update, including explicit clears. * * @param borders - Public range-border update. */ export declare function toGoogleBorders(borders: z.infer): Omit; /** * Converts native-table header and band-color updates. * * @param style - Public native-table style update. */ export declare function toGoogleTableRowsPropertiesUpdate(style: z.infer): sheets_v4.Schema$TableRowsProperties; /** * Normalizes provider native-table row colors. * * @param style - Provider native-table row properties. */ export declare function normalizeGoogleTableStyle(style: sheets_v4.Schema$TableRowsProperties | null | undefined): { firstBandColor?: `#${string}` | { theme: "link" | "text" | "background" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6"; } | undefined; footerColor?: `#${string}` | { theme: "link" | "text" | "background" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6"; } | undefined; headerColor?: `#${string}` | { theme: "link" | "text" | "background" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6"; } | undefined; secondBandColor?: `#${string}` | { theme: "link" | "text" | "background" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6"; } | undefined; }; /** * Converts public row or column band colors into provider properties. * * @param properties - Public row or column band colors. */ export declare function toGoogleBandingProperties(properties: z.infer | z.infer): sheets_v4.Schema$BandingProperties; /** * Normalizes complete provider row or column banding properties. * * @param properties - Provider row or column band colors. * @throws When required provider band colors are absent. */ export declare function normalizeGoogleBandingProperties(properties: sheets_v4.Schema$BandingProperties): { firstBandColor: `#${string}` | { theme: "link" | "text" | "background" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6"; }; secondBandColor: `#${string}` | { theme: "link" | "text" | "background" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6"; }; footerColor?: `#${string}` | { theme: "link" | "text" | "background" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6"; } | undefined; headerColor?: `#${string}` | { theme: "link" | "text" | "background" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6"; } | undefined; }; /** * Converts a public conditional-format rule into a provider rule. * * @param rule - Public boolean or gradient rule. * @param ranges - Resolved provider grid ranges. */ export declare function toGoogleConditionalFormatRule(rule: z.infer, ranges: sheets_v4.Schema$GridRange[]): sheets_v4.Schema$ConditionalFormatRule; /** * Normalizes a provider conditional rule body while rejecting unknown values. * * @param rule - Provider conditional-format rule. * @throws When the provider rule is malformed or contains unknown values. */ export declare function normalizeGoogleConditionalRule(rule: sheets_v4.Schema$ConditionalFormatRule): { condition: { type: "numberGreaterThan" | "numberGreaterThanOrEqual" | "numberLessThan" | "numberLessThanOrEqual" | "numberEqual" | "numberNotEqual" | "textContains" | "textNotContains" | "textStartsWith" | "textEndsWith" | "textEqual" | "dateEqual"; value: string; } | { type: "numberBetween" | "numberNotBetween"; values: [string, string]; } | { type: "dateBefore" | "dateAfter"; value: string | { relativeDate: "today" | "yesterday" | "pastYear" | "pastMonth" | "pastWeek" | "tomorrow"; }; } | { type: "blank" | "notBlank"; } | { formula: string; type: "customFormula"; }; format: { backgroundColor?: `#${string}` | { theme: "link" | "text" | "background" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6"; } | undefined; bold?: boolean | undefined; italic?: boolean | undefined; strikethrough?: boolean | undefined; textColor?: `#${string}` | { theme: "link" | "text" | "background" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6"; } | undefined; }; type: "boolean"; } | { max: { color: `#${string}` | { theme: "link" | "text" | "background" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6"; }; type: "number" | "percent" | "percentile"; value: string; } | { color: `#${string}` | { theme: "link" | "text" | "background" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6"; }; type: "max"; }; min: { color: `#${string}` | { theme: "link" | "text" | "background" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6"; }; type: "number" | "percent" | "percentile"; value: string; } | { color: `#${string}` | { theme: "link" | "text" | "background" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6"; }; type: "min"; }; type: "gradient"; midpoint?: { color: `#${string}` | { theme: "link" | "text" | "background" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6"; }; type: "number" | "percent" | "percentile"; value: string; } | undefined; }; export type GoogleSheetsBandedRange = z.infer; //# sourceMappingURL=formatting.d.ts.map