import * as HttpBody from "@effect/platform/HttpBody";
import * as HttpClient from "@effect/platform/HttpClient";
import * as KeyValueStore from "@effect/platform/KeyValueStore";
import * as Effect from "effect/Effect";
import * as Option from "effect/Option";
import * as Schema from "effect/Schema";
export declare const AUTH_PLATFORM_URL: URL;
declare const RefreshTokenResponse_base: Schema.Class<RefreshTokenResponse, {
    token: Schema.refine<string, typeof Schema.Trimmed>;
    refresh_token: Schema.NullOr<typeof Schema.String>;
    session_update_action: Schema.SchemaClass<string, string, never>;
    expires_in: Schema.refine<number, typeof Schema.Int>;
    user: Schema.Struct<{
        id: Schema.filter<typeof Schema.NonEmptyTrimmedString>;
        accounts: Schema.Array$<Schema.Union<[typeof Schema.NonEmptyTrimmedString, Schema.refine<`0x${string}`, Schema.Schema<string, string, never>>]>>;
    }>;
}, Schema.Struct.Encoded<{
    token: Schema.refine<string, typeof Schema.Trimmed>;
    refresh_token: Schema.NullOr<typeof Schema.String>;
    session_update_action: Schema.SchemaClass<string, string, never>;
    expires_in: Schema.refine<number, typeof Schema.Int>;
    user: Schema.Struct<{
        id: Schema.filter<typeof Schema.NonEmptyTrimmedString>;
        accounts: Schema.Array$<Schema.Union<[typeof Schema.NonEmptyTrimmedString, Schema.refine<`0x${string}`, Schema.Schema<string, string, never>>]>>;
    }>;
}>, never, {
    readonly token: string;
} & {
    readonly refresh_token: string | null;
} & {
    readonly session_update_action: string;
} & {
    readonly expires_in: number;
} & {
    readonly user: {
        readonly id: string;
        readonly accounts: readonly string[];
    };
}, {}, {}>;
export declare class RefreshTokenResponse extends RefreshTokenResponse_base {
}
declare const AuthStorageSchema_base: Schema.Class<AuthStorageSchema, {
    accessToken: typeof Schema.NonEmptyTrimmedString;
    refreshToken: typeof Schema.NonEmptyTrimmedString;
    userId: Schema.filter<typeof Schema.NonEmptyTrimmedString>;
    accounts: Schema.optional<Schema.Array$<Schema.Union<[typeof Schema.NonEmptyTrimmedString, Schema.refine<`0x${string}`, Schema.Schema<string, string, never>>]>>>;
    expiry: Schema.optional<Schema.filter<typeof Schema.Int>>;
}, Schema.Struct.Encoded<{
    accessToken: typeof Schema.NonEmptyTrimmedString;
    refreshToken: typeof Schema.NonEmptyTrimmedString;
    userId: Schema.filter<typeof Schema.NonEmptyTrimmedString>;
    accounts: Schema.optional<Schema.Array$<Schema.Union<[typeof Schema.NonEmptyTrimmedString, Schema.refine<`0x${string}`, Schema.Schema<string, string, never>>]>>>;
    expiry: Schema.optional<Schema.filter<typeof Schema.Int>>;
}>, never, {
    readonly accounts?: readonly string[] | undefined;
} & {
    readonly accessToken: string;
} & {
    readonly refreshToken: string;
} & {
    readonly userId: string;
} & {
    readonly expiry?: number | undefined;
}, {}, {}>;
export declare class AuthStorageSchema extends AuthStorageSchema_base {
}
declare const AuthTokenExpiredError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
    readonly _tag: "Amp/errors/auth/AuthTokenExpiredError";
} & Readonly<A>;
export declare class AuthTokenExpiredError extends AuthTokenExpiredError_base {
}
declare const AuthRateLimitError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
    readonly _tag: "Amp/errors/auth/AuthRateLimitError";
} & Readonly<A>;
export declare class AuthRateLimitError extends AuthRateLimitError_base<{
    readonly retryAfter: number;
    readonly message: string;
}> {
}
declare const AuthRefreshError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
    readonly _tag: "Amp/errors/auth/AuthRefreshError";
} & Readonly<A>;
export declare class AuthRefreshError extends AuthRefreshError_base<{
    readonly status: number;
    readonly message: string;
}> {
}
declare const AuthUserMismatchError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
    readonly _tag: "Amp/errors/auth/AuthUserMismatchError";
} & Readonly<A>;
export declare class AuthUserMismatchError extends AuthUserMismatchError_base<{
    readonly expected: string;
    readonly received: string;
}> {
}
declare const AuthService_base: Effect.Service.Class<AuthService, "Amp/AuthService", {
    readonly dependencies: readonly [import("effect/Layer").Layer<KeyValueStore.KeyValueStore, import("@effect/platform/Error").PlatformError, import("@effect/platform/Path").Path | import("@effect/platform/FileSystem").FileSystem>, import("effect/Layer").Layer<HttpClient.HttpClient, never, never>];
    readonly effect: Effect.Effect<{
        readonly refreshAccessToken: (storedAuth: AuthStorageSchema) => Effect.Effect<AuthStorageSchema, import("effect/ParseResult").ParseError | import("@effect/platform/Error").PlatformError | AuthTokenExpiredError | AuthRateLimitError | AuthRefreshError | AuthUserMismatchError | import("@effect/platform/HttpClientError").HttpClientError | HttpBody.HttpBodyError | import("effect/Cause").TimeoutException, never>;
        readonly get: () => Effect.Effect<Option.Option<AuthStorageSchema>, never, never>;
        readonly set: (data: AuthStorageSchema) => Effect.Effect<void, import("effect/ParseResult").ParseError | import("@effect/platform/Error").PlatformError, never>;
        readonly delete: Effect.Effect<void, import("@effect/platform/Error").PlatformError, never>;
    }, never, KeyValueStore.KeyValueStore | HttpClient.HttpClient>;
}>;
export declare class AuthService extends AuthService_base {
}
export declare const layer: import("effect/Layer").Layer<AuthService, import("@effect/platform/Error").PlatformError, import("@effect/platform/Path").Path | import("@effect/platform/FileSystem").FileSystem>;
export {};
//# sourceMappingURL=Auth.d.ts.map