yandex-cloud
Version:
Yandex Cloud SDK
38 lines (30 loc) • 751 B
TypeScript
import { ChannelCredentials } from 'grpc';
interface GenericConfig {
pollInterval?: number;
}
export interface OAuthCredentialsConfig extends GenericConfig {
oauthToken: string;
}
export interface IamTokenCredentialsConfig extends GenericConfig {
iamToken: string;
}
export class Session {
constructor(
config:
| OAuthCredentialsConfig
| IamTokenCredentialsConfig
| GenericConfig
);
setEndpoint(newEndpointAddress: string);
client<T>(cls: {
new (
address: string,
credentials: ChannelCredentials,
options?: object
): T;
}): T;
}
export class TokenService {
initialize(): Promise<void>;
getToken(): string;
}