UNPKG

@square/web-payments-sdk-types

Version:

Types for Square's Web Payments SDK

50 lines (49 loc) 1.57 kB
import { SqError } from './types'; /** * The specified element was not found */ declare class ElementNotFoundError extends SqError { /** * @param {string} elementIdSelector - the Element ID not found. */ constructor(element: HTMLElement | string); } /** * A `PaymentRequest` object is malformed */ declare class InvalidPaymentRequestError extends SqError { /** * @param {string[][]} missingFields - an array of string tuples describing the missing property and its type * @param {string[]} additionalErrors - an array of strings describing other validation errors */ constructor(missingFields?: string[][], additionalErrors?: string[]); } /** * A `PaymentRequestUpdate` object is malformed. */ declare class InvalidPaymentRequestUpdateError extends SqError { /** * @param {string[][]} missingFields - an array of string tuples describing the missing property and its type */ constructor(missingFields?: string[][]); } /** * An `eventListener callback` is throwing an unexpected error. */ declare class InvalidEventListenerCallbackError extends SqError { /** * @param {String} event * @param {String} message */ constructor(event: string, message: string); } /** * Invalid method parameter errors. */ declare class InvalidOptionError extends SqError { /** * @inheritdoc */ constructor(optionName: string); } export { ElementNotFoundError, InvalidPaymentRequestError, InvalidPaymentRequestUpdateError, InvalidEventListenerCallbackError, InvalidOptionError, };