import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import type { CallContext, CallOptions } from "nice-grpc-common";
import type { FileDescriptorProto as FileDescriptorProto1 } from "ts-proto-descriptors";
import { Any } from "../../google/protobuf/any";
import { Subject } from "./auth";
export declare const protobufPackage = "io.restorecommerce.token";
export interface TokenData {
    id?: string | undefined;
    payload?: Any | undefined;
    expires_in?: Date | undefined;
    type?: string | undefined;
    subject?: Subject | undefined;
}
export interface Identifier {
    id?: string | undefined;
    type?: string | undefined;
    subject?: Subject | undefined;
}
export interface GrantId {
    grant_id?: string | undefined;
    subject?: Subject | undefined;
}
export declare const TokenData: MessageFns<TokenData>;
export declare const Identifier: MessageFns<Identifier>;
export declare const GrantId: MessageFns<GrantId>;
/** Microservice definition. */
export type TokenServiceDefinition = typeof TokenServiceDefinition;
export declare const TokenServiceDefinition: {
    readonly name: "TokenService";
    readonly fullName: "io.restorecommerce.token.TokenService";
    readonly methods: {
        /** creates or upserts ID_token to `Redis` and returns sucess or failure message */
        readonly upsert: {
            readonly name: "upsert";
            readonly requestType: typeof TokenData;
            readonly requestStream: false;
            readonly responseType: typeof Any;
            readonly responseStream: false;
            readonly options: {};
        };
        readonly find: {
            readonly name: "find";
            readonly requestType: typeof Identifier;
            readonly requestStream: false;
            readonly responseType: typeof Any;
            readonly responseStream: false;
            readonly options: {
                readonly _unknownFields: {
                    readonly 248008: readonly [Buffer<ArrayBufferLike>];
                };
            };
        };
        /** removes the id_token from redis */
        readonly destroy: {
            readonly name: "destroy";
            readonly requestType: typeof Identifier;
            readonly requestStream: false;
            readonly responseType: typeof Any;
            readonly responseStream: false;
            readonly options: {};
        };
        /** Destroy/Drop/Remove a stored id_token by its grantId property reference. */
        readonly revokeByGrantId: {
            readonly name: "revokeByGrantId";
            readonly requestType: typeof GrantId;
            readonly requestStream: false;
            readonly responseType: typeof Any;
            readonly responseStream: false;
            readonly options: {};
        };
        /** Mark a stored id_token as consumed (not yet expired though!). Future finds for this id should be fulfilled with an object containing additional property named "consumed" with a truthy value (timestamp, date, boolean, etc). */
        readonly consume: {
            readonly name: "consume";
            readonly requestType: typeof Identifier;
            readonly requestStream: false;
            readonly responseType: typeof Any;
            readonly responseStream: false;
            readonly options: {};
        };
    };
};
export interface TokenServiceImplementation<CallContextExt = {}> {
    /** creates or upserts ID_token to `Redis` and returns sucess or failure message */
    upsert(request: TokenData, context: CallContext & CallContextExt): Promise<DeepPartial<Any>>;
    find(request: Identifier, context: CallContext & CallContextExt): Promise<DeepPartial<Any>>;
    /** removes the id_token from redis */
    destroy(request: Identifier, context: CallContext & CallContextExt): Promise<DeepPartial<Any>>;
    /** Destroy/Drop/Remove a stored id_token by its grantId property reference. */
    revokeByGrantId(request: GrantId, context: CallContext & CallContextExt): Promise<DeepPartial<Any>>;
    /** Mark a stored id_token as consumed (not yet expired though!). Future finds for this id should be fulfilled with an object containing additional property named "consumed" with a truthy value (timestamp, date, boolean, etc). */
    consume(request: Identifier, context: CallContext & CallContextExt): Promise<DeepPartial<Any>>;
}
export interface TokenServiceClient<CallOptionsExt = {}> {
    /** creates or upserts ID_token to `Redis` and returns sucess or failure message */
    upsert(request: DeepPartial<TokenData>, options?: CallOptions & CallOptionsExt): Promise<Any>;
    find(request: DeepPartial<Identifier>, options?: CallOptions & CallOptionsExt): Promise<Any>;
    /** removes the id_token from redis */
    destroy(request: DeepPartial<Identifier>, options?: CallOptions & CallOptionsExt): Promise<Any>;
    /** Destroy/Drop/Remove a stored id_token by its grantId property reference. */
    revokeByGrantId(request: DeepPartial<GrantId>, options?: CallOptions & CallOptionsExt): Promise<Any>;
    /** Mark a stored id_token as consumed (not yet expired though!). Future finds for this id should be fulfilled with an object containing additional property named "consumed" with a truthy value (timestamp, date, boolean, etc). */
    consume(request: DeepPartial<Identifier>, options?: CallOptions & CallOptionsExt): Promise<Any>;
}
type ProtoMetaMessageOptions = {
    options?: {
        [key: string]: any;
    };
    fields?: {
        [key: string]: {
            [key: string]: any;
        };
    };
    oneof?: {
        [key: string]: {
            [key: string]: any;
        };
    };
    nested?: {
        [key: string]: ProtoMetaMessageOptions;
    };
};
export interface ProtoMetadata {
    fileDescriptor: FileDescriptorProto1;
    references: {
        [key: string]: any;
    };
    dependencies?: ProtoMetadata[];
    options?: {
        options?: {
            [key: string]: any;
        };
        services?: {
            [key: string]: {
                options?: {
                    [key: string]: any;
                };
                methods?: {
                    [key: string]: {
                        [key: string]: any;
                    };
                };
            };
        };
        messages?: {
            [key: string]: ProtoMetaMessageOptions;
        };
        enums?: {
            [key: string]: {
                options?: {
                    [key: string]: any;
                };
                values?: {
                    [key: string]: {
                        [key: string]: any;
                    };
                };
            };
        };
    };
}
export declare const protoMetadata: ProtoMetadata;
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
    [K in keyof T]?: DeepPartial<T[K]>;
} : Partial<T>;
export interface MessageFns<T> {
    encode(message: T, writer?: BinaryWriter): BinaryWriter;
    decode(input: BinaryReader | Uint8Array, length?: number): T;
    fromJSON(object: any): T;
    toJSON(message: T): unknown;
    create(base?: DeepPartial<T>): T;
    fromPartial(object: DeepPartial<T>): T;
}
export {};
//# sourceMappingURL=token.d.ts.map