import { AwsCredentialIdentityProvider } from '@aws-sdk/types';
import * as vitest from 'vitest';
import { Duration } from '@awsless/duration';
import { QoS } from '@awsless/iot';
export { QoS } from '@awsless/iot';
import { IoTCustomAuthorizerResult } from 'aws-lambda';

declare const regions: readonly ["us-east-2", "us-east-1", "us-west-1", "us-west-2", "af-south-1", "ap-east-1", "ap-south-2", "ap-southeast-3", "ap-southeast-4", "ap-south-1", "ap-northeast-3", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ca-central-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-south-1", "eu-west-3", "eu-south-2", "eu-north-1", "eu-central-2", "me-south-1", "me-central-1", "sa-east-1"];
type Region = (typeof regions)[number];

type Credentials = AwsCredentialIdentityProvider;

type CommandContext = {
    region: Region;
    credentials: Credentials;
    accountId: string;
};
type CommandHandler = (context: CommandContext) => Promise<void>;

interface AlertMock {
}
interface AlertMockResponse {
}
declare const mockAlert: (cb: (mock: AlertMock) => void) => AlertMockResponse;

declare const mockCache: () => void;

interface FunctionMock {
}
interface FunctionMockResponse {
}
declare const mockFunction: (cb: (mock: FunctionMock) => void) => FunctionMockResponse;

declare const mockMetric: () => void;

declare const mockPubSub: () => vitest.Mock<any, any>;

interface QueueMock {
}
interface QueueMockResponse {
}
declare const mockQueue: (cb: (mock: QueueMock) => void) => QueueMockResponse;

interface TaskMock {
}
interface TaskMockResponse {
}
declare const mockTask: (cb: (mock: TaskMock) => void) => TaskMockResponse;

interface TopicMock {
}
interface TopicMockResponse {
}
declare const mockTopic: (cb: (mock: TopicMock) => void) => TopicMockResponse;

declare const getAlertName: <N extends string>(resourceName: N) => `app--alert--${N}`;
interface AlertResources {
}
declare const Alert: AlertResources;

declare const getAuthProps: (name: string) => {
    readonly userPoolId: string | undefined;
    readonly clientId: string | undefined;
};
interface AuthResources {
}
declare const Auth: AuthResources;

declare const getCacheProps: (name: string, stack?: string) => {
    readonly host: string;
    readonly port: number;
};
interface CacheResources {
}
declare const Cache: CacheResources;

declare const getConfigName: (name: string) => string;
declare const getConfigValue: (name: string) => string;
declare const setConfigValue: (name: string, value: string) => void;
interface ConfigResources {
}
declare const Config: ConfigResources;

declare const getFunctionName: <N extends string, S extends string = "stack">(resourceName: N, stackName?: S) => `app--${S}--function--${N}`;
interface FunctionResources {
}
declare const Function: FunctionResources;
declare const Fn: FunctionResources;

declare const getMetricName: (name: string) => string;
declare const getMetricNamespace: (stack?: string, app?: string) => string;
interface MetricResources {
}
declare const Metric: MetricResources;

declare const getPubSubTopic: <N extends string>(name: N) => `app/pubsub/${N}`;

type PublishOptions = {
    qos?: QoS;
};
declare const PubSub: {
    publish(topic: string, event: string, payload: unknown, opts?: PublishOptions): Promise<void>;
};
type PubsubAuthorizerResponse = {
    authorized: boolean;
    principalId?: string;
    publish?: string[];
    subscribe?: string[];
    disconnectAfter?: Duration;
    refreshAfter?: Duration;
};
type PubsubAuthorizerEvent = {
    protocolData: {
        mqtt?: {
            password?: string;
        };
    };
};
declare const pubsubAuthorizerHandle: (cb: (token: string) => PubsubAuthorizerResponse | Promise<PubsubAuthorizerResponse>) => Promise<(event: PubsubAuthorizerEvent) => Promise<IoTCustomAuthorizerResult>>;
declare const pubsubAuthorizerResponse: (props: PubsubAuthorizerResponse) => IoTCustomAuthorizerResult;

declare const getQueueName: <N extends string, S extends string = "stack">(resourceName: N, stackName?: S) => `app--${S}--queue--${N}`;
declare const getQueueUrl: (name: string, stack?: string) => string | undefined;
interface QueueResources {
}
declare const Queue: QueueResources;

type RpcAuthorizerResponse = {
    authorized: false;
} | {
    authorized: true;
    context?: unknown;
    lockKey?: string;
    allowedFunctions?: string[];
    ttl: Duration;
};

declare const getSearchName: <N extends string, S extends string = "stack">(resourceName: N, stackName?: S) => `app--${S}--search--${N}`;
declare const getSearchProps: (name: string, stack?: string) => {
    readonly domain: string | undefined;
};
interface SearchResources {
}
declare const Search: SearchResources;

declare const getSiteBucketName: <N extends string, S extends string = "stack">(resourceName: N, stackName?: S) => `app--${S}--site--${N}--app-id`;

declare const getStoreName: <N extends string, S extends string = "stack">(resourceName: N, stackName?: S) => `app--${S}--store--${N}--app-id`;
interface StoreResources {
}
declare const Store: StoreResources;

declare const getTableName: <N extends string, S extends string = "stack">(resourceName: N, stackName?: S) => `app--${S}--table--${N}`;
interface TableResources {
}
declare const Table: TableResources;

declare const getTaskName: <N extends string, S extends string = "stack">(resourceName: N, stackName?: S) => `app--${S}--task--${N}`;
interface TaskResources {
}
declare const Task: TaskResources;

declare const getTopicName: <N extends string>(resourceName: N) => `app--topic--${N}`;
interface TopicResources {
}
declare const Topic: TopicResources;

declare const APP: "app";
declare const STACK: "stack";

export { APP, Alert, type AlertMock, type AlertMockResponse, type AlertResources, Auth, type AuthResources, Cache, type CacheResources, type CommandContext, type CommandHandler, Config, type ConfigResources, Fn, Function, type FunctionMock, type FunctionMockResponse, type FunctionResources, Metric, type MetricResources, PubSub, type PublishOptions, Queue, type QueueMock, type QueueMockResponse, type QueueResources, type RpcAuthorizerResponse, STACK, Search, type SearchResources, Store, type StoreResources, Table, type TableResources, Task, type TaskMock, type TaskMockResponse, type TaskResources, Topic, type TopicMock, type TopicMockResponse, type TopicResources, getAlertName, getAuthProps, getCacheProps, getConfigName, getConfigValue, getFunctionName, getMetricName, getMetricNamespace, getPubSubTopic, getQueueName, getQueueUrl, getSearchName, getSearchProps, getSiteBucketName, getStoreName, getTableName, getTaskName, getTopicName, mockAlert, mockCache, mockFunction, mockMetric, mockPubSub, mockQueue, mockTask, mockTopic, pubsubAuthorizerHandle, pubsubAuthorizerResponse, setConfigValue };
