Skip to content

🎥 Make videos programmatically with React

Fix all TS2742 errors across the monorepo for tsgo compatibility

Jonny Burgercc9349ca9b1a
diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts
index be1e55584e..1374fa4113 100644
--- a/packages/core/src/index.ts
+++ b/packages/core/src/index.ts
@@ -263,4 +263,5 @@ export type _InternalTypes = {
ProResProfile: ProResProfile;
};
+export type {AnyComposition};
export type {DelayRenderScope, LoopDisplay, UseBufferState};
diff --git a/packages/eslint-config-flat/src/index.ts b/packages/eslint-config-flat/src/index.ts
index b5225ea5f0..7267d92126 100644
--- a/packages/eslint-config-flat/src/index.ts
+++ b/packages/eslint-config-flat/src/index.ts
@@ -1,5 +1,6 @@
import eslint from '@eslint/js';
import remotionPlugin from '@remotion/eslint-plugin';
+import type {Linter} from 'eslint';
import reactPlugin from 'eslint-plugin-react';
import hooksPlugin from 'eslint-plugin-react-hooks';
import tseslint from 'typescript-eslint';
@@ -8,7 +9,7 @@ export const makeConfig = ({
remotionDir,
}: {
remotionDir: string | undefined;
-}): tseslint.ConfigArray =>
+}): Linter.Config[] =>
tseslint.config(
{
ignores: [
@@ -63,8 +64,8 @@ export const makeConfig = ({
rules: remotionPlugin.configs.recommended.rules,
...(remotionDir ? {files: [remotionDir]} : {}),
},
- );
+ ) as Linter.Config[];
-export const config: tseslint.ConfigArray = makeConfig({
+export const config: Linter.Config[] = makeConfig({
remotionDir: undefined,
});
diff --git a/packages/lambda-client/src/aws-clients.ts b/packages/lambda-client/src/aws-clients.ts
index 6198d44568..a969cfe8a7 100644
--- a/packages/lambda-client/src/aws-clients.ts
+++ b/packages/lambda-client/src/aws-clients.ts
@@ -7,10 +7,10 @@ import {getServiceClient} from './get-service-client';
import type {AwsRegion} from './regions';
import type {RequestHandler} from './types';
-export const getCloudWatchLogsClient = (
+export function getCloudWatchLogsClient(
region: AwsRegion,
requestHandler: RequestHandler | null,
-): CloudWatchLogsClient => {
+): CloudWatchLogsClient {
return getServiceClient({
region,
service: 'cloudwatch',
@@ -18,14 +18,14 @@ export const getCloudWatchLogsClient = (
forcePathStyle: false,
requestHandler,
});
-};
+}
-export const getLambdaClient = (
+export function getLambdaClient(
region: AwsRegion,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_timeoutInTest: number | undefined,
requestHandler: RequestHandler | null,
-): LambdaClient => {
+): LambdaClient {
return getServiceClient({
region,
service: 'lambda',
@@ -33,12 +33,12 @@ export const getLambdaClient = (
forcePathStyle: false,
requestHandler,
});
-};
+}
-export const getIamClient = (
+export function getIamClient(
region: AwsRegion,
requestHandler: RequestHandler | null,
-): IAMClient => {
+): IAMClient {
return getServiceClient({
region,
service: 'iam',
@@ -46,12 +46,12 @@ export const getIamClient = (
forcePathStyle: false,
requestHandler,
});
-};
+}
-export const getServiceQuotasClient = (
+export function getServiceQuotasClient(
region: AwsRegion,
requestHandler: RequestHandler | null,
-): ServiceQuotasClient => {
+): ServiceQuotasClient {
return getServiceClient({
region,
service: 'servicequotas',
@@ -59,12 +59,12 @@ export const getServiceQuotasClient = (
forcePathStyle: false,
requestHandler,
});
-};
+}
-export const getStsClient = (
+export function getStsClient(
region: AwsRegion,
requestHandler: RequestHandler | null,
-): STSClient => {
+): STSClient {
return getServiceClient({
region,
service: 'sts',
@@ -72,4 +72,4 @@ export const getStsClient = (
forcePathStyle: false,
requestHandler,
});
-};
+}
diff --git a/packages/lambda-client/src/express-webhook.ts b/packages/lambda-client/src/express-webhook.ts
index 3b15b2badf..d8edf8c7ba 100644
--- a/packages/lambda-client/src/express-webhook.ts
+++ b/packages/lambda-client/src/express-webhook.ts
@@ -3,10 +3,12 @@ import type {NextWebhookArgs} from './app-router-webhook';
import {addHeaders} from './pages-router-webhook';
import {validateWebhookSignature} from './validate-webhook-signature';
-export const expressWebhook = (options: NextWebhookArgs) => {
+export function expressWebhook(
+ options: NextWebhookArgs,
+): (req: Request, res: Response) => Promise<void> {
const {testing, extraHeaders, secret, onSuccess, onTimeout, onError} =
options;
- return async (req: Request, res: Response) => {
+ return async (req: Request, res: Response): Promise<void> => {
// add headers to enable testing
if (testing) {
const testingheaders = {
@@ -54,4 +56,4 @@ export const expressWebhook = (options: NextWebhookArgs) => {
});
}
};
-};
+}
diff --git a/packages/lambda-client/src/get-credentials.ts b/packages/lambda-client/src/get-credentials.ts
index ff9a1270e2..f8c225f669 100644
--- a/packages/lambda-client/src/get-credentials.ts
+++ b/packages/lambda-client/src/get-credentials.ts
@@ -9,10 +9,10 @@ type CredentialPair = {
};
type AwsCredentialIdentityProvider = ReturnType<typeof fromIni>;
-export const getCredentials = ():
+export function getCredentials():
| CredentialPair
| AwsCredentialIdentityProvider
- | undefined => {
+ | undefined {
if (isInsideLambda()) {
return undefined;
}
@@ -78,4 +78,4 @@ export const getCredentials = ():
}
return undefined;
-};
+}
diff --git a/packages/lambda-client/src/get-function-version.ts b/packages/lambda-client/src/get-function-version.ts
index e5dc60543f..c6b06e6ffe 100644
--- a/packages/lambda-client/src/get-function-version.ts
+++ b/packages/lambda-client/src/get-function-version.ts
@@ -7,7 +7,7 @@ import {awsImplementation} from './aws-provider';
import type {AwsRegion} from './regions';
import type {RequestHandler} from './types';
-export const getFunctionVersion = async ({
+export async function getFunctionVersion({
functionName,
region,
logLevel,
@@ -17,7 +17,7 @@ export const getFunctionVersion = async ({
region: AwsRegion;
logLevel: LogLevel;
requestHandler: RequestHandler | null | undefined;
-}): Promise<string> => {
+}): Promise<string> {
try {
// For now, we'll pass requestHandler to the awsImplementation if needed
// This might require deeper changes in the serverless-client framework
@@ -46,4 +46,4 @@ export const getFunctionVersion = async ({
throw err;
}
-};
+}
diff --git a/packages/lambda-client/src/get-s3-client.ts b/packages/lambda-client/src/get-s3-client.ts
index c9278b2691..2e50b7fa91 100644
--- a/packages/lambda-client/src/get-s3-client.ts
+++ b/packages/lambda-client/src/get-s3-client.ts
@@ -5,7 +5,7 @@ import {getServiceClient} from './get-service-client';
import type {AwsRegion} from './regions';
import type {RequestHandler} from './types';
-export const getS3Client = ({
+export function getS3Client({
region,
customCredentials,
forcePathStyle,
@@ -15,7 +15,7 @@ export const getS3Client = ({
customCredentials: CustomCredentials<AwsProvider> | null;
forcePathStyle: boolean;
requestHandler: RequestHandler | null;
-}): S3Client => {
+}): S3Client {
return getServiceClient({
region: customCredentials?.region ?? region,
service: 's3',
@@ -23,4 +23,4 @@ export const getS3Client = ({
forcePathStyle,
requestHandler,
});
-};
+}
diff --git a/packages/lambda-client/src/get-service-client.ts b/packages/lambda-client/src/get-service-client.ts
index 7b5372d025..6dd26ac553 100644
--- a/packages/lambda-client/src/get-service-client.ts
+++ b/packages/lambda-client/src/get-service-client.ts
@@ -88,7 +88,7 @@ const _clients: Partial<
>
> = {};
-export const getServiceClient = <T extends keyof ServiceMapping>({
+export function getServiceClient<T extends keyof ServiceMapping>({
region,
service,
customCredentials,
@@ -100,7 +100,7 @@ export const getServiceClient = <T extends keyof ServiceMapping>({
customCredentials: CustomCredentials<AwsProvider> | null;
forcePathStyle: boolean;
requestHandler: RequestHandler | null;
-}): ServiceMapping[T] => {
+}): ServiceMapping[T] {
const Client = (() => {
if (service === 'cloudwatch') {
return CloudWatchLogsClient;
@@ -192,4 +192,4 @@ export const getServiceClient = <T extends keyof ServiceMapping>({
}
return _clients[key] as ServiceMapping[T];
-};
+}
diff --git a/packages/lambda-client/src/index.ts b/packages/lambda-client/src/index.ts
index 095769cbd6..f88e4b471c 100644
--- a/packages/lambda-client/src/index.ts
+++ b/packages/lambda-client/src/index.ts
@@ -108,7 +108,48 @@ export {
export type {RequestHandler} from './types';
export {validateWebhookSignature} from './validate-webhook-signature';
-export const LambdaClientInternals = {
+export const LambdaClientInternals: {
+ generateRandomHashWithLifeCycleRule: typeof generateRandomHashWithLifeCycleRule;
+ getLambdaClient: typeof getLambdaClient;
+ getS3Client: typeof getS3Client;
+ getS3RenderUrl: typeof getS3RenderUrl;
+ getIamClient: typeof getIamClient;
+ getStsClient: typeof getStsClient;
+ getCloudWatchLogsClient: typeof getCloudWatchLogsClient;
+ getServiceQuotasClient: typeof getServiceQuotasClient;
+ parseJsonOrThrowSource: typeof parseJsonOrThrowSource;
+ getCloudwatchMethodUrl: typeof getCloudwatchMethodUrl;
+ getCloudwatchRendererUrl: typeof getCloudwatchRendererUrl;
+ MAX_EPHEMERAL_STORAGE_IN_MB: typeof MAX_EPHEMERAL_STORAGE_IN_MB;
+ parseFunctionName: typeof parseFunctionName;
+ isFlakyError: typeof isFlakyError;
+ convertToServeUrlImplementation: typeof convertToServeUrlImplementation;
+ randomHashImplementation: typeof randomHashImplementation;
+ parseBucketName: typeof parseBucketName;
+ makeLambdaRenderMediaPayload: typeof makeLambdaRenderMediaPayload;
+ renderMediaOnLambdaOptionalToRequired: typeof renderMediaOnLambdaOptionalToRequired;
+ internalDeleteRender: typeof internalDeleteRender;
+ internalGetSites: typeof internalGetSites;
+ getLifeCycleRules: typeof getLifeCycleRules;
+ awsImplementation: typeof awsImplementation;
+ runtimePreferenceOptions: typeof runtimePreferenceOptions;
+ validateAwsRegion: typeof validateAwsRegion;
+ validateDiskSizeInMb: typeof validateDiskSizeInMb;
+ validateMemorySize: typeof validateMemorySize;
+ DEFAULT_CLOUDWATCH_RETENTION_PERIOD: typeof DEFAULT_CLOUDWATCH_RETENTION_PERIOD;
+ DEFAULT_EPHEMERAL_STORAGE_IN_MB: typeof DEFAULT_EPHEMERAL_STORAGE_IN_MB;
+ LAMBDA_VERSION_STRING: typeof LAMBDA_VERSION_STRING;
+ pLimit: typeof pLimit;
+ makeS3ServeUrl: typeof makeS3ServeUrl;
+ validateServeUrl: typeof validateServeUrl;
+ getEnvVariable: typeof getEnvVariable;
+ internalRenderMediaOnLambdaRaw: typeof internalRenderMediaOnLambdaRaw;
+ internalRenderStillOnLambda: typeof internalRenderStillOnLambda;
+ cleanItems: typeof cleanItems;
+ makeLambdaRenderStillPayload: typeof makeLambdaRenderStillPayload;
+ getRenderProgressPayload: typeof getRenderProgressPayload;
+ innerSpeculateFunctionName: typeof innerSpeculateFunctionName;
+} = {
generateRandomHashWithLifeCycleRule,
getLambdaClient,
getS3Client,
diff --git a/packages/lambda-client/src/lifecycle-rules.ts b/packages/lambda-client/src/lifecycle-rules.ts
index f9690c67c3..4cd13e20d2 100644
--- a/packages/lambda-client/src/lifecycle-rules.ts
+++ b/packages/lambda-client/src/lifecycle-rules.ts
@@ -80,7 +80,7 @@ const deleteLCRules = async ({
}
};
-export const applyLifeCyleOperation = async ({
+export async function applyLifeCyleOperation({
enableFolderExpiry,
bucketName,
region,
@@ -94,7 +94,7 @@ export const applyLifeCyleOperation = async ({
customCredentials: CustomCredentials<AwsProvider> | null;
forcePathStyle: boolean;
requestHandler: RequestHandler | null;
-}) => {
+}): Promise<void> {
if (enableFolderExpiry === null) {
return;
}
@@ -116,4 +116,4 @@ export const applyLifeCyleOperation = async ({
requestHandler,
});
}
-};
+}
diff --git a/packages/lambda-client/src/read-file.ts b/packages/lambda-client/src/read-file.ts
index 6668e80f11..5b18da7068 100644
--- a/packages/lambda-client/src/read-file.ts
+++ b/packages/lambda-client/src/read-file.ts
@@ -4,7 +4,7 @@ import {getS3Client} from './get-s3-client';
import type {AwsRegion} from './regions';
import type {RequestHandler} from './types';
-export const lambdaReadFileImplementation = async ({
+export async function lambdaReadFileImplementation({
bucketName,
key,
region,
@@ -18,7 +18,7 @@ export const lambdaReadFileImplementation = async ({
expectedBucketOwner: string | null;
forcePathStyle: boolean;
requestHandler: RequestHandler | null;
-}): Promise<Readable> => {
+}): Promise<Readable> {
const {Body} = await getS3Client({
region,
customCredentials: null,
@@ -32,4 +32,4 @@ export const lambdaReadFileImplementation = async ({
}),
);
return Body as Readable;
-};
+}
diff --git a/packages/lambda-client/src/render-still-on-lambda.ts b/packages/lambda-client/src/render-still-on-lambda.ts
index 91daa9877f..49421559bd 100644
--- a/packages/lambda-client/src/render-still-on-lambda.ts
+++ b/packages/lambda-client/src/render-still-on-lambda.ts
@@ -162,7 +162,7 @@ export const internalRenderStillOnLambda = wrapWithErrorHandling(
* @description Renders a still image inside a lambda function and writes it to the specified output location.
* @see [Documentation](https://remotion.dev/docs/lambda/renderstillonlambda)
*/
-export const renderStillOnLambda = (
+export function renderStillOnLambda(
input: RenderStillOnLambdaInput & {
/**
* @deprecated Renamed to `jpegQuality`
@@ -177,7 +177,7 @@ export const renderStillOnLambda = (
*/
apiKey?: string | null;
},
-) => {
+): Promise<RenderStillOnLambdaOutput> {
return internalRenderStillOnLambda({
chromiumOptions: input.chromiumOptions ?? {},
composition: input.composition,
@@ -212,4 +212,4 @@ export const renderStillOnLambda = (
mediaCacheSizeInBytes: input.mediaCacheSizeInBytes ?? null,
isProduction: input.isProduction ?? null,
});
-};
+}
diff --git a/packages/lambda/src/api/create-function.ts b/packages/lambda/src/api/create-function.ts
index 90c760655c..e0be0894bd 100644
--- a/packages/lambda/src/api/create-function.ts
+++ b/packages/lambda/src/api/create-function.ts
@@ -25,6 +25,26 @@ import {getLayers} from '../shared/get-layers';
import {lambdaInsightsExtensions} from '../shared/lambda-insights-extensions';
import {ROLE_NAME} from './iam-validation/suggested-policy';
+type CreateFunctionInput = {
+ createCloudWatchLogGroup: boolean;
+ region: AwsRegion;
+ zipFile: string;
+ functionName: string;
+ accountId: string;
+ memorySizeInMb: number;
+ timeoutInSeconds: number;
+ alreadyCreated: boolean;
+ retentionInDays: number;
+ ephemerealStorageInMb: number;
+ customRoleArn: string;
+ enableLambdaInsights: boolean;
+ logLevel: LogLevel;
+ vpcSubnetIds: string;
+ vpcSecurityGroupIds: string;
+ runtimePreference: RuntimePreference;
+ requestHandler: RequestHandler | null;
+};
+
export const createFunction = async ({
createCloudWatchLogGroup,
region,
@@ -43,25 +63,7 @@ export const createFunction = async ({
vpcSecurityGroupIds,
runtimePreference,
requestHandler,
-}: {
- createCloudWatchLogGroup: boolean;
- region: AwsRegion;
- zipFile: string;
- functionName: string;
- accountId: string;
- memorySizeInMb: number;
- timeoutInSeconds: number;
- alreadyCreated: boolean;
- retentionInDays: number;
- ephemerealStorageInMb: number;
- customRoleArn: string;
- enableLambdaInsights: boolean;
- logLevel: LogLevel;
- vpcSubnetIds: string;
- vpcSecurityGroupIds: string;
- runtimePreference: RuntimePreference;
- requestHandler: RequestHandler | null;
-}): Promise<{FunctionName: string}> => {
+}: CreateFunctionInput): Promise<{FunctionName: string}> => {
if (createCloudWatchLogGroup) {
RenderInternals.Log.verbose(
{indent: false, logLevel},
diff --git a/packages/lambda/src/api/deploy-site.ts b/packages/lambda/src/api/deploy-site.ts
index a157fafb80..10822236d1 100644
--- a/packages/lambda/src/api/deploy-site.ts
+++ b/packages/lambda/src/api/deploy-site.ts
@@ -214,7 +214,15 @@ const mandatoryDeploySite = async ({
};
};
-export const internalDeploySite = wrapWithErrorHandling(mandatoryDeploySite);
+export type InternalDeploySiteInput = MandatoryParameters &
+ OptionalParameters & {
+ providerSpecifics: ProviderSpecifics<AwsProvider>;
+ fullClientSpecifics: FullClientSpecifics<AwsProvider>;
+ };
+
+export const internalDeploySite: (
+ input: InternalDeploySiteInput,
+) => DeploySiteOutput = wrapWithErrorHandling(mandatoryDeploySite);
/*
* @description Deploys a Remotion project to a GCP storage bucket to prepare it for rendering on Cloud Run.
diff --git a/packages/lambda/src/api/iam-validation/simulate-rule.ts b/packages/lambda/src/api/iam-validation/simulate-rule.ts
index 3da1998cfd..a3478dbe2f 100644
--- a/packages/lambda/src/api/iam-validation/simulate-rule.ts
+++ b/packages/lambda/src/api/iam-validation/simulate-rule.ts
@@ -9,14 +9,18 @@ export type SimulationResult = {
name: string;
};
-export const simulateRule = async (options: {
+type SimulateRuleOptions = {
region: AwsRegion;
actionNames: string[];
arn: string;
resource: string[];
retries: number;
requestHandler: RequestHandler | null;
-}): Promise<SimulationResult[]> => {
+};
+
+export const simulateRule = async (
+ options: SimulateRuleOptions,
+): Promise<SimulationResult[]> => {
try {
const res = await LambdaClientInternals.getIamClient(
options.region,
diff --git a/packages/lambda/src/api/upload-dir.ts b/packages/lambda/src/api/upload-dir.ts
index 2a47bc945a..cb3c9d63f4 100644
--- a/packages/lambda/src/api/upload-dir.ts
+++ b/packages/lambda/src/api/upload-dir.ts
@@ -59,6 +59,18 @@ async function getFiles(
const limit = LambdaClientInternals.pLimit(5);
+type UploadDirInput = {
+ bucket: string;
+ region: AwsRegion;
+ localDir: string;
+ keyPrefix: string;
+ onProgress: (progress: UploadDirProgress) => void;
+ privacy: Privacy;
+ toUpload: string[];
+ forcePathStyle: boolean;
+ requestHandler: RequestHandler | null;
+};
+
export const uploadDir = async ({
bucket,
region,
@@ -69,17 +81,7 @@ export const uploadDir = async ({
toUpload,
forcePathStyle,
requestHandler,
-}: {
- bucket: string;
- region: AwsRegion;
- localDir: string;
- keyPrefix: string;
- onProgress: (progress: UploadDirProgress) => void;
- privacy: Privacy;
- toUpload: string[];
- forcePathStyle: boolean;
- requestHandler: RequestHandler | null;
-}) => {
+}: UploadDirInput): Promise<void> => {
const files = await getFiles(localDir, localDir, toUpload);
const progresses: {[key: string]: number} = {};
for (const file of files) {
diff --git a/packages/lambda/src/cli/commands/quotas/increase.ts b/packages/lambda/src/cli/commands/quotas/increase.ts
index fda5227f03..bea70f251b 100644
--- a/packages/lambda/src/cli/commands/quotas/increase.ts
+++ b/packages/lambda/src/cli/commands/quotas/increase.ts
@@ -34,10 +34,10 @@ const makeQuotaUrl = ({
return `https://${region}.console.aws.amazon.com/servicequotas/home/services/lambda/quotas/${quotaId}`;
};
-export const quotasIncreaseCommand = async (
+export async function quotasIncreaseCommand(
logLevel: LogLevel,
requestHandler: RequestHandler | null,
-) => {
+): Promise<void> {
const region = getAwsRegion();
const [concurrencyLimit, defaultConcurrencyLimit, changes] =
@@ -152,4 +152,4 @@ export const quotasIncreaseCommand = async (
{indent: false, logLevel},
`Requested increase successfully. Run "${BINARY_NAME} ${QUOTAS_COMMAND}" to check whether your request was approved.`,
);
-};
+}
diff --git a/packages/lambda/src/functions/helpers/read-with-progress.ts b/packages/lambda/src/functions/helpers/read-with-progress.ts
index 7be5e7f040..f786746877 100644
--- a/packages/lambda/src/functions/helpers/read-with-progress.ts
+++ b/packages/lambda/src/functions/helpers/read-with-progress.ts
@@ -16,6 +16,20 @@ export type LambdaReadFileProgress = (progress: {
percent: number;
}) => unknown;
+type LambdaDownloadFileWithProgressInput = {
+ bucketName: string;
+ key: string;
+ region: AwsRegion;
+ expectedBucketOwner: string;
+ outputPath: string;
+ onProgress: LambdaReadFileProgress;
+ customCredentials: CustomCredentials<AwsProvider> | null;
+ logLevel: LogLevel;
+ forcePathStyle: boolean;
+ requestHandler: RequestHandler;
+ abortSignal: AbortSignal;
+};
+
export const lambdaDownloadFileWithProgress = async ({
bucketName,
key,
@@ -28,19 +42,10 @@ export const lambdaDownloadFileWithProgress = async ({
forcePathStyle,
requestHandler,
abortSignal,
-}: {
- bucketName: string;
- key: string;
- region: AwsRegion;
- expectedBucketOwner: string;
- outputPath: string;
- onProgress: LambdaReadFileProgress;
- customCredentials: CustomCredentials<AwsProvider> | null;
- logLevel: LogLevel;
- forcePathStyle: boolean;
- requestHandler: RequestHandler;
- abortSignal: AbortSignal;
-}): Promise<{sizeInBytes: number; to: string}> => {
+}: LambdaDownloadFileWithProgressInput): Promise<{
+ sizeInBytes: number;
+ to: string;
+}> => {
const client = LambdaClientInternals.getS3Client({
region,
customCredentials,
diff --git a/packages/lambda/src/internals.ts b/packages/lambda/src/internals.ts
index e1d9b58ce6..2d87ef71d6 100644
--- a/packages/lambda/src/internals.ts
+++ b/packages/lambda/src/internals.ts
@@ -1,8 +1,26 @@
+import type {AwsProvider} from '@remotion/lambda-client';
+import type {LogLevel} from '@remotion/renderer';
+import type {FullClientSpecifics, ProviderSpecifics} from '@remotion/serverless';
+import type {DeploySiteOutput, InternalDeploySiteInput} from './api/deploy-site';
import {internalDeploySite} from './api/deploy-site';
import {executeCommand} from './cli/index';
+import type {AwsLayer} from './shared/hosted-layers';
import {getLayers} from './shared/get-layers';
-export const LambdaInternals = {
+export const LambdaInternals: {
+ executeCommand: (
+ args: string[],
+ remotionRoot: string,
+ logLevel: LogLevel,
+ providerSpecifics: ProviderSpecifics<AwsProvider> | null,
+ fullClientSpecifics: FullClientSpecifics<AwsProvider> | null,
+ ) => Promise<void>;
+ internalDeploySite: (input: InternalDeploySiteInput) => DeploySiteOutput;
+ getLayers: (options: {
+ option: import('@remotion/lambda-client').RuntimePreference;
+ region: import('@remotion/lambda-client').AwsRegion;
+ }) => AwsLayer[];
+} = {
executeCommand,
internalDeploySite,
getLayers,
diff --git a/packages/studio/src/api/get-zod-schema-from-primitive.ts b/packages/studio/src/api/get-zod-schema-from-primitive.ts
index b8373cae62..c3f1295fa2 100644
--- a/packages/studio/src/api/get-zod-schema-from-primitive.ts
+++ b/packages/studio/src/api/get-zod-schema-from-primitive.ts
@@ -1,6 +1,7 @@
-import type {ZodType} from '../components/get-zod-if-possible';
+import type {ZodType} from 'zod';
+import type {ZodType as ZodNamespace} from '../components/get-zod-if-possible';
-export const getZodSchemaFromPrimitive = (value: unknown, z: ZodType) => {
+export function getZodSchemaFromPrimitive(value: unknown, z: ZodNamespace): ZodType {
if (typeof value === 'string') {
return z.string();
}
@@ -17,4 +18,4 @@ export const getZodSchemaFromPrimitive = (value: unknown, z: ZodType) => {
throw new Error(
`visualControl(): Specify a schema for this value: ${stringified ?? '[non-serializable value]'}. See https://remotion.dev/docs/studio/visual-control`,
);
-};
+}
diff --git a/packages/studio/src/api/helpers/calc-new-props.ts b/packages/studio/src/api/helpers/calc-new-props.ts
index 2df7d8c5b4..ed4b617c2c 100644
--- a/packages/studio/src/api/helpers/calc-new-props.ts
+++ b/packages/studio/src/api/helpers/calc-new-props.ts
@@ -1,4 +1,4 @@
-import type {_InternalTypes} from 'remotion';
+import type {AnyComposition} from 'remotion';
import {Internals, getRemotionEnvironment} from 'remotion';
import type {AnyZodObject} from 'zod';
@@ -12,7 +12,7 @@ export const calcNewProps = (
compositionId: string,
defaultProps: UpdateDefaultPropsFunction,
): {
- composition: _InternalTypes['AnyComposition'];
+ composition: AnyComposition;
generatedDefaultProps: Record<string, unknown>;
} => {
if (!getRemotionEnvironment().isStudio) {
diff --git a/packages/studio/src/components/get-zod-if-possible.tsx b/packages/studio/src/components/get-zod-if-possible.tsx
index 06f6943f22..b54594f10f 100644
--- a/packages/studio/src/components/get-zod-if-possible.tsx
+++ b/packages/studio/src/components/get-zod-if-possible.tsx
@@ -13,14 +13,14 @@ export type ZodTypesType = Awaited<
typeof import('@remotion/zod-types')
>;
-export const getZodIfPossible = async (): Promise<ZodType | null> => {
+export async function getZodIfPossible(): Promise<ZodType | null> {
try {
const {z} = await import('zod');
return z;
} catch {
return null;
}
-};
+}
export const getZTypesIfPossible = async (): Promise<ZodTypesType | null> => {
try {
@@ -31,10 +31,10 @@ export const getZTypesIfPossible = async (): Promise<ZodTypesType | null> => {
}
};
-export const useZodIfPossible = () => {
+export function useZodIfPossible(): ZodType | null {
const context = useContext(ZodContext);
return context?.zod ?? null;
-};
+}
export const useZodTypesIfPossible = () => {
const context = useContext(ZodContext);
diff --git a/packages/template-still/src/server/handler.ts b/packages/template-still/src/server/handler.ts
index a8e5b017f2..c943fcd7bc 100644
--- a/packages/template-still/src/server/handler.ts
+++ b/packages/template-still/src/server/handler.ts
@@ -4,9 +4,9 @@ import pLimit from "p-limit";
// Only allow to process 1 image at a time
const limited = pLimit(1);
-export const handler = (
+export function handler(
fn: (req: Request, res: Response) => Promise<unknown>,
-) => {
+): (request: Request, response: Response) => Promise<void> {
return async function (request: Request, response: Response): Promise<void> {
try {
await limited(() => fn(request, response));
@@ -20,4 +20,4 @@ export const handler = (
});
}
};
-};
+}