@altostra/core
Version:
Core library for shared types and logic
53 lines (52 loc) • 2.59 kB
TypeScript
import type { Arn } from "../../aws/CustomTypes/Arn";
import type { NonEmptyString } from "../../common/CustomTypes/NonEmptyString";
import type { AnyTypeValidation, ObjectValidations, TypeValidation } from '@altostra/type-validations';
import type { ResourceId } from "./ResourceId";
export interface ResourceBase {
id: ResourceId;
name: string;
description?: string;
type: string;
}
export interface Ref {
type: 'ref';
id: string;
}
export declare const isRef: import("@altostra/type-validations").ObjectOfTypeValidation<Ref>;
export declare const resourceBaseValidators: ObjectValidations<Omit<ResourceBase, 'type'>>;
export declare const isResourceBase: import("@altostra/type-validations").ObjectOfTypeValidation<Omit<ResourceBase, "type">>;
export interface AWSData<T> {
aws: T;
}
export interface GCPData<T> {
gcp: T;
}
export interface AzureData<T> {
azure: T;
}
export interface MultiVendorPropertyBase<AWS, GCP = AWS, Azure = AWS> {
aws?: AWS;
gcp?: GCP;
azure?: Azure;
}
export declare type MultiVendorProperty<AWS, GCP = AWS, Azure = AWS> = MultiVendorPropertyBase<AWS, GCP, Azure> & (AWSData<AWS> | AzureData<Azure> | GCPData<GCP>);
export interface FullMultiVendorPropertyValidationOptions<AWS, GCP, Azure> {
aws: AnyTypeValidation<AWS>;
gcp: AnyTypeValidation<GCP>;
azure: AnyTypeValidation<Azure>;
}
export declare type MultiVendorPropertyValidationOptions<AWS, GCP, Azure> = Partial<FullMultiVendorPropertyValidationOptions<AWS, GCP, Azure>> & (Pick<FullMultiVendorPropertyValidationOptions<AWS, GCP, Azure>, 'aws'> | Pick<FullMultiVendorPropertyValidationOptions<AWS, GCP, Azure>, 'azure'> | Pick<FullMultiVendorPropertyValidationOptions<AWS, GCP, Azure>, 'gcp'>);
export declare function multiVendorPropertyValidation<T>(internalValidation: AnyTypeValidation<T>): TypeValidation<MultiVendorProperty<T>>;
export declare function multiVendorPropertyValidation<AWS = never, GCP = never, Azure = never>({ aws, gcp, azure, }: MultiVendorPropertyValidationOptions<AWS, GCP, Azure>): TypeValidation<MultiVendorProperty<AWS, GCP, Azure>>;
export interface AWSStorageEncryption {
kmsKeyId: Arn | null;
}
export declare type StorageEncryption = MultiVendorProperty<AWSStorageEncryption, never, never>;
export interface VPC {
securityGroups: NonEmptyString[];
subnets: NonEmptyString[];
}
export declare const isStorageEncryption: TypeValidation<MultiVendorProperty<{
kmsKeyId: Arn | null;
}, never, never>>;
export declare const isVPC: import("@altostra/type-validations").ObjectOfTypeValidation<VPC>;