import { EndpointFetchHttpClient } from '../net/EndpointFetchHttpClient.js';
import { StripeEventEmitter } from '../StripeEventEmitter.js';
import { PlatformFunctions } from './PlatformFunctions.js';
const unsupportedRuntimeError = (method, alternative) => new Error(`Stripe: \`${method}()\` is not available in the extensibility runtime.` +
    (alternative ? ` ${alternative}` : ''));
/**
 * Platform functions for extensibility scripts.
 */
export class ExtensibilityPlatformFunctions extends PlatformFunctions {
    /** @override */
    emitWarning(_warning) {
        // Extensibility runtime has no user-visible warning target.
    }
    /** @override */
    getEnv() {
        return null;
    }
    /** @override */
    getRuntimeVersion() {
        return null;
    }
    /** @override */
    getDefaultMaxNetworkRetries() {
        return 0;
    }
    /** @override */
    createDefaultAuthenticator() {
        // Authentication is injected automatically.
        return () => Promise.resolve();
    }
    /** @override */
    createEmitter() {
        return new StripeEventEmitter();
    }
    /** @override */
    tryBufferData(data) {
        return Promise.resolve(data);
    }
    /** @override */
    createDefaultHttpClient() {
        return new EndpointFetchHttpClient();
    }
    /** @override */
    createFetchHttpClient() {
        throw unsupportedRuntimeError('createFetchHttpClient', 'Use the default `endpointFetch` HTTP client instead.');
    }
    /** @override */
    createNodeHttpClient() {
        throw unsupportedRuntimeError('createNodeHttpClient', 'Use the default `endpointFetch` HTTP client instead.');
    }
    /** @override */
    createNodeCryptoProvider() {
        throw unsupportedRuntimeError('createNodeCryptoProvider');
    }
    /** @override */
    createDefaultCryptoProvider() {
        throw unsupportedRuntimeError('createDefaultCryptoProvider', 'Pass an explicit `CryptoProvider` for crypto-dependent helpers.');
    }
}
//# sourceMappingURL=ExtensibilityPlatformFunctions.js.map