@vue-stripe/vue-stripe
Version:
Vue Stripe elements and composables for Stripe.js
220 lines • 12.9 kB
TypeScript
import { StripeExpressCheckoutElement as StripeExpressCheckoutElementType, StripeExpressCheckoutElementOptions, StripeExpressCheckoutElementClickEvent, StripeExpressCheckoutElementConfirmEvent, StripeExpressCheckoutElementReadyEvent, StripeError, StripeExpressCheckoutElementShippingAddressChangeEvent, StripeExpressCheckoutElementShippingRateChangeEvent, StripeExpressCheckoutElementUpdateOptions } from '@stripe/stripe-js';
import { DefineComponent, Ref, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue-demi';
interface Props {
options?: StripeExpressCheckoutElementOptions;
}
interface ShippingAddressChangeEvent {
address: {
city?: string;
country: string;
line1?: string;
line2?: string;
postal_code?: string;
state?: string;
};
name?: string;
}
interface ShippingRateChangeEvent {
shippingRate: {
id: string;
amount: number;
displayName: string;
};
}
declare function __VLS_template(): {
attrs: Partial<{}>;
slots: {
error?(_: {
error: string;
}): any;
loading?(_: {}): any;
};
refs: {
elementRef: HTMLDivElement;
};
rootEl: HTMLDivElement;
};
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
declare const __VLS_component: DefineComponent<Props, {
element: Ref<{
mount: (domElement: string | HTMLElement) => void;
blur: () => void;
clear: () => void;
destroy: () => void;
focus: () => void;
unmount: () => void;
on: {
(eventType: "ready", handler: (event: StripeExpressCheckoutElementReadyEvent) => any): StripeExpressCheckoutElementType;
(eventType: "click", handler: (event: StripeExpressCheckoutElementClickEvent) => any): StripeExpressCheckoutElementType;
(eventType: "focus", handler: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "blur", handler: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "escape", handler: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "loaderror", handler: (event: {
elementType: "expressCheckout";
error: StripeError;
}) => any): StripeExpressCheckoutElementType;
(eventType: "confirm", handler: (event: StripeExpressCheckoutElementConfirmEvent) => any): StripeExpressCheckoutElementType;
(eventType: "cancel", handler: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "shippingaddresschange", handler: (event: StripeExpressCheckoutElementShippingAddressChangeEvent) => any): StripeExpressCheckoutElementType;
(eventType: "shippingratechange", handler: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any): StripeExpressCheckoutElementType;
};
once: {
(eventType: "ready", handler: (event: StripeExpressCheckoutElementReadyEvent) => any): StripeExpressCheckoutElementType;
(eventType: "click", handler: (event: StripeExpressCheckoutElementClickEvent) => any): StripeExpressCheckoutElementType;
(eventType: "focus", handler: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "blur", handler: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "escape", handler: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "loaderror", handler: (event: {
elementType: "expressCheckout";
error: StripeError;
}) => any): StripeExpressCheckoutElementType;
(eventType: "confirm", handler: (event: StripeExpressCheckoutElementConfirmEvent) => any): StripeExpressCheckoutElementType;
(eventType: "cancel", handler: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "shippingaddresschange", handler: (event: StripeExpressCheckoutElementShippingAddressChangeEvent) => any): StripeExpressCheckoutElementType;
(eventType: "shippingratechange", handler: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any): StripeExpressCheckoutElementType;
};
off: {
(eventType: "ready", handler?: (event: StripeExpressCheckoutElementReadyEvent) => any): StripeExpressCheckoutElementType;
(eventType: "click", handler?: (event: StripeExpressCheckoutElementClickEvent) => any): StripeExpressCheckoutElementType;
(eventType: "focus", handler?: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "blur", handler?: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "escape", handler?: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "loaderror", handler?: (event: {
elementType: "expressCheckout";
error: StripeError;
}) => any): StripeExpressCheckoutElementType;
(eventType: "confirm", handler?: (event: StripeExpressCheckoutElementConfirmEvent) => any): StripeExpressCheckoutElementType;
(eventType: "cancel", handler?: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "shippingaddresschange", handler?: (event: StripeExpressCheckoutElementShippingAddressChangeEvent) => any): StripeExpressCheckoutElementType;
(eventType: "shippingratechange", handler?: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any): StripeExpressCheckoutElementType;
};
update: (options: StripeExpressCheckoutElementUpdateOptions) => StripeExpressCheckoutElementType;
} | null, StripeExpressCheckoutElementType | {
mount: (domElement: string | HTMLElement) => void;
blur: () => void;
clear: () => void;
destroy: () => void;
focus: () => void;
unmount: () => void;
on: {
(eventType: "ready", handler: (event: StripeExpressCheckoutElementReadyEvent) => any): StripeExpressCheckoutElementType;
(eventType: "click", handler: (event: StripeExpressCheckoutElementClickEvent) => any): StripeExpressCheckoutElementType;
(eventType: "focus", handler: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "blur", handler: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "escape", handler: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "loaderror", handler: (event: {
elementType: "expressCheckout";
error: StripeError;
}) => any): StripeExpressCheckoutElementType;
(eventType: "confirm", handler: (event: StripeExpressCheckoutElementConfirmEvent) => any): StripeExpressCheckoutElementType;
(eventType: "cancel", handler: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "shippingaddresschange", handler: (event: StripeExpressCheckoutElementShippingAddressChangeEvent) => any): StripeExpressCheckoutElementType;
(eventType: "shippingratechange", handler: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any): StripeExpressCheckoutElementType;
};
once: {
(eventType: "ready", handler: (event: StripeExpressCheckoutElementReadyEvent) => any): StripeExpressCheckoutElementType;
(eventType: "click", handler: (event: StripeExpressCheckoutElementClickEvent) => any): StripeExpressCheckoutElementType;
(eventType: "focus", handler: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "blur", handler: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "escape", handler: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "loaderror", handler: (event: {
elementType: "expressCheckout";
error: StripeError;
}) => any): StripeExpressCheckoutElementType;
(eventType: "confirm", handler: (event: StripeExpressCheckoutElementConfirmEvent) => any): StripeExpressCheckoutElementType;
(eventType: "cancel", handler: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "shippingaddresschange", handler: (event: StripeExpressCheckoutElementShippingAddressChangeEvent) => any): StripeExpressCheckoutElementType;
(eventType: "shippingratechange", handler: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any): StripeExpressCheckoutElementType;
};
off: {
(eventType: "ready", handler?: (event: StripeExpressCheckoutElementReadyEvent) => any): StripeExpressCheckoutElementType;
(eventType: "click", handler?: (event: StripeExpressCheckoutElementClickEvent) => any): StripeExpressCheckoutElementType;
(eventType: "focus", handler?: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "blur", handler?: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "escape", handler?: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "loaderror", handler?: (event: {
elementType: "expressCheckout";
error: StripeError;
}) => any): StripeExpressCheckoutElementType;
(eventType: "confirm", handler?: (event: StripeExpressCheckoutElementConfirmEvent) => any): StripeExpressCheckoutElementType;
(eventType: "cancel", handler?: (event: {
elementType: "expressCheckout";
}) => any): StripeExpressCheckoutElementType;
(eventType: "shippingaddresschange", handler?: (event: StripeExpressCheckoutElementShippingAddressChangeEvent) => any): StripeExpressCheckoutElementType;
(eventType: "shippingratechange", handler?: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any): StripeExpressCheckoutElementType;
};
update: (options: StripeExpressCheckoutElementUpdateOptions) => StripeExpressCheckoutElementType;
} | null>;
loading: Ref<boolean, boolean>;
error: Ref<string | null, string | null>;
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
cancel: () => any;
click: (event: StripeExpressCheckoutElementClickEvent) => any;
ready: (event: StripeExpressCheckoutElementReadyEvent) => any;
confirm: (event: StripeExpressCheckoutElementConfirmEvent) => any;
shippingaddresschange: (event: ShippingAddressChangeEvent) => any;
shippingratechange: (event: ShippingRateChangeEvent) => any;
}, string, PublicProps, Readonly<Props> & Readonly<{
onCancel?: () => any;
onClick?: (event: StripeExpressCheckoutElementClickEvent) => any;
onReady?: (event: StripeExpressCheckoutElementReadyEvent) => any;
onConfirm?: (event: StripeExpressCheckoutElementConfirmEvent) => any;
onShippingaddresschange?: (event: ShippingAddressChangeEvent) => any;
onShippingratechange?: (event: ShippingRateChangeEvent) => any;
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
elementRef: HTMLDivElement;
}, HTMLDivElement>;
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};
//# sourceMappingURL=VueStripeExpressCheckoutElement.vue.d.ts.map