import { postEvent as _postEvent, PostEventFn, RequestFn, InvokeCustomMethodOptions, CustomMethodParams, CustomMethodName } from '@telegram-apps/bridge'; import { AbortablePromise } from 'better-promises'; import { LaunchParamsLike } from '@telegram-apps/transformers'; /** * Launch parameters stored in the package state. */ export type PackageLaunchParams = Omit & Partial>; export interface ConfigureOptions { /** * Launch parameters used across the package. * @default Being extracted using the `retrieveLaunchParams` function. * @see retrieveLaunchParams */ launchParams?: PackageLaunchParams; /** * Custom postEvent function. * @default The `createPostEvent` function will be used with the version, specified in * the `launchParams` option. * @see createPostEvent */ postEvent?: PostEventFn; } export declare const $postEvent: import('@telegram-apps/signals').Signal; export declare const _$launchParams: import('@telegram-apps/signals').Signal, $launchParams: import('@telegram-apps/signals').Computed; export declare const version: import('@telegram-apps/signals').Computed; /** * Configures package global dependencies. * @param options - configuration additional options. */ export declare function configure(options?: ConfigureOptions): void; /** * @returns A new request identifier. */ export declare function createRequestId(): string; /** * Invokes known custom method. Returns method execution result. * @param method - method name. * @param params - method parameters. * @param options - additional options. * @throws {InvokeCustomMethodError} Invocation completed with some error. */ export declare function invokeCustomMethod(method: M, params: CustomMethodParams, options?: InvokeCustomMethodOptions): AbortablePromise; /** * Invokes unknown custom method. Returns method execution result. * @param method - method name. * @param params - method parameters. * @param options - additional options. * @throws {InvokeCustomMethodError} Invocation completed with some error. */ export declare function invokeCustomMethod(method: string, params: object, options?: InvokeCustomMethodOptions): AbortablePromise; /** * `request` function from the bridge with applied global `postEvent` option. */ export declare const request: RequestFn; /** * Shortcut for $postEvent call. */ export declare const postEvent: PostEventFn;