UNPKG

@ribajs/shopify

Version:

Shopify extension for Riba.js

60 lines (59 loc) 1.81 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; }; login: ShopifyLoginFormComponent["login"]; create: ShopifyLoginFormComponent["create"]; recover: ShopifyLoginFormComponent["recover"]; recoverBack: ShopifyLoginFormComponent["recoverBack"]; } export declare class ShopifyLoginFormComponent extends Component { static tagName: string; static get observedAttributes(): string[]; protected loginCustomerForm: HTMLFormElement | null; protected createCustomerForm: HTMLFormElement | null; protected recoverCustomerForm: HTMLFormElement | null; scope: Scope; constructor(); protected connectedCallback(): void; login(event: Event): false | undefined; create(event: Event): false | undefined; recover(event: Event): false | undefined; recoverBack(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 {};