UNPKG

@ribajs/shopify

Version:

Shopify extension for Riba.js

52 lines (51 loc) 1.4 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 { form: { customer: { email: string; password: string; }; }; loginCustomer: { validation: ValidationObject; }; createCustomer: { validation: ValidationObject; }; recoverCustomer: { validation: ValidationObject; }; post: ShopifyCommentsFormComponent["post"]; } export declare class ShopifyCommentsFormComponent extends Component { static tagName: string; static get observedAttributes(): string[]; protected newCommentForm: HTMLFormElement | null; scope: Scope; constructor(); protected connectedCallback(): void; post(event: Event): false | undefined; protected initValidation(): void; protected validate(form: HTMLFormElement, validationScope: ValidationObject): void; protected afterBind(): Promise<void>; protected requiredAttributes(): string[]; protected template(): Promise<string | null>; } export {};