@whoof/infra
Version:
SST application factory functions for consistent patterns in Whop applications
54 lines • 1.71 kB
TypeScript
export interface AppConfig {
name: string;
path: string;
domain?: string;
/**
* The port that the dev server will listen on.
* The proxy will listen the upstream port on the next port.
* The studio will listen on the next port.
*/
devPort: number;
}
export interface AppInfra<Sst extends CreateAppSstConstructors> {
vpc: InstanceType<Sst["aws"]["Vpc"]>;
db: InstanceType<Sst["aws"]["Aurora"]>;
}
export interface CreateAppSstConstructors {
aws: {
Nextjs: new (...args: any[]) => any;
Function: new (...args: any[]) => any;
Vpc: new (...args: any[]) => any;
Aurora: new (...args: any[]) => any;
};
x: {
DevCommand: new (...args: any[]) => any;
};
}
export interface CreateAppAwsConstructors {
lambda: {
Invocation: new (...args: any[]) => any;
};
}
export interface CreateAppOptions<Sst extends CreateAppSstConstructors, Aws extends CreateAppAwsConstructors> {
config: AppConfig;
infra: AppInfra<Sst>;
sst: Sst;
aws: Aws;
environment: Record<string, any>;
version: string;
additionalLinks?: any[];
runMigrator?: boolean;
appFunctionTransform?: {
server?: (args: {
memory: string;
timeout: string;
}) => any;
};
}
export declare function createApp<Sst extends CreateAppSstConstructors, Aws extends CreateAppAwsConstructors>(options: CreateAppOptions<Sst, Aws>): {
app: InstanceType<Sst["aws"]["Nextjs"]>;
migrator: InstanceType<Sst["aws"]["Function"]>;
invocation?: InstanceType<Aws["lambda"]["Invocation"]>;
studioCommand: InstanceType<Sst["x"]["DevCommand"]>;
};
//# sourceMappingURL=index.d.ts.map