UNPKG

@ribajs/shopify

Version:

Shopify extension for Riba.js

51 lines (50 loc) 1.53 kB
import { Component, ScopeBase } from "@ribajs/core"; export interface ValidationRule { required: boolean; minlength?: number; maxlength?: number; max?: number; min?: number; error: string; isEmail?: boolean; isPhone?: boolean; onlyNumbers?: boolean; } export interface ValidationObject { valid: boolean; rules?: { [key: string]: ValidationRule; }; } interface Scope extends ScopeBase { editAddress: { [addressID: string]: { validation: ValidationObject; }; }; showFormId: string; createAddress: { validation: ValidationObject; }; edit: ShopifyAddressesComponent["edit"]; create: ShopifyAddressesComponent["create"]; delete: ShopifyAddressesComponent["delete"]; } export declare class ShopifyAddressesComponent extends Component { static tagName: string; static get observedAttributes(): string[]; protected editAddressForm: HTMLFormElement | null; protected createAddressForm: HTMLFormElement | null; scope: Scope; constructor(); protected connectedCallback(): void; edit(id: string, event: Event): false | undefined; create(event: Event): false | undefined; delete(id: string): Promise<void>; protected initValidation(): void; protected validate(form: HTMLFormElement, validationScope: ValidationObject): void; protected afterBind(): Promise<void>; protected requiredAttributes(): string[]; protected template(): Promise<string | null>; } export {};