@ribajs/shopify
Version:
Shopify extension for Riba.js
37 lines (36 loc) • 1.76 kB
TypeScript
import { Component, ScopeBase } from "@ribajs/core";
import { ShopifyCartLineItem, ShopifyCartObject, ShopifyCustomerAddress, ShopifyShippingRatesNormalized } from "../../interfaces/index.js";
export interface Scope extends ScopeBase {
cart: ShopifyCartObject | null;
shippingAddress: ShopifyCustomerAddress | null;
estimateShippingRate: boolean;
shippingRates: ShopifyShippingRatesNormalized;
removeItem: ShopifyCartComponent["removeItem"];
increaseItem: ShopifyCartComponent["increaseItem"];
decreaseItem: ShopifyCartComponent["decreaseItem"];
getItem: ShopifyCartComponent["getItem"];
onItemQuantityChanged: ShopifyCartComponent["onItemQuantityChanged"];
pending: boolean;
}
export declare class ShopifyCartComponent extends Component {
static tagName: string;
static get observedAttributes(): string[];
protected requiredAttributes(): string[];
scope: Scope;
protected getScopeDefaults(): Scope;
protected set cart(cart: ShopifyCartObject | null);
protected get cart(): ShopifyCartObject | null;
constructor();
protected connectedCallback(): void;
removeItem(lineItem: ShopifyCartLineItem): void;
increaseItem(lineItem: ShopifyCartLineItem): void;
decreaseItem(lineItem: ShopifyCartLineItem): void;
onItemQuantityChanged(lineItem: ShopifyCartLineItem, event: Event, scope: Scope, htmlEl: HTMLInputElement): void;
getItem(id: number | string): ShopifyCartLineItem | null;
protected onCartRequestStart(): void;
protected onCartRequestComplete(cart: ShopifyCartObject): void;
protected beforeBind(): Promise<void>;
protected disconnectedCallback(): void;
protected afterBind(): Promise<void>;
protected template(): Promise<string | null>;
}