| import type { File, NullLiteral } from '@babel/types'; | |
| import type { InsertCompositionElementRequest, InsertableCompositionElement, InsertableCompositionElementPosition, SequenceNodePathRemapping } from '@remotion/studio-shared'; | |
| import type { namedTypes } from 'ast-types'; | |
| import type { SequenceNodePath } from 'remotion'; | |
| import { type SourceEdit } from './source-edits'; | |
| export type CodemodEnvironment = { | |
| rootDir: string; | |
| dirname: (fileName: string) => string; | |
| extname: (fileName: string) => string; | |
| fileExists: (fileName: string) => boolean; | |
| isAbsolute: (fileName: string) => boolean; | |
| join: (...parts: string[]) => string; | |
| pathSeparator: string; | |
| readFile: (fileName: string) => Promise<string>; | |
| relative: (from: string, to: string) => string; | |
| resolve: (...parts: string[]) => string; | |
| svgMarkupToJsx: (markup: string) => Promise<namedTypes.JSXElement>; | |
| }; | |
| export declare const makeInMemoryCodemodEnvironment: ({ project, svgMarkupToJsx, }: { | |
| project: { | |
| files: Record<string, string>; | |
| rootDir: string; | |
| }; | |
| svgMarkupToJsx: CodemodEnvironment['svgMarkupToJsx']; | |
| }) => CodemodEnvironment; | |
| export type ResolvedCompositionComponent = { | |
| source: string; | |
| line: number; | |
| column: number; | |
| canAddSequence: boolean; | |
| }; | |
| export type ResolvedCompositionComponentWithFile = ResolvedCompositionComponent & { | |
| fileName: string; | |
| exportName: string | 'default'; | |
| }; | |
| export type LocalComponentDeclaration = namedTypes.VariableDeclarator | namedTypes.FunctionDeclaration | namedTypes.ClassDeclaration; | |
| export type DefaultExportDeclaration = namedTypes.ExportDefaultDeclaration['declaration']; | |
| export declare const getComponentRootNode: (declaration: LocalComponentDeclaration | DefaultExportDeclaration) => namedTypes.JSXElement | namedTypes.JSXFragment | null; | |
| export declare const formatTranslateValue: ({ x, y, }: InsertableCompositionElementPosition) => string; | |
| export declare const getDeclarationByExportName: ({ ast, exportName, }: { | |
| ast: File; | |
| exportName: string | 'default'; | |
| }) => LocalComponentDeclaration | DefaultExportDeclaration | null; | |
| export declare const addElementToComponentRoot: ({ ast, exportName, element, }: { | |
| ast: File; | |
| exportName: string | 'default'; | |
| element: namedTypes.JSXElement; | |
| }) => number; | |
| export declare const getNullComponentRoot: (declaration: LocalComponentDeclaration | DefaultExportDeclaration) => NullLiteral | null; | |
| export declare const getInsertionRootSourceEdit: ({ insertInside, input, insertion, nullRoot, prettierConfigOverride, root, }: { | |
| insertInside: boolean; | |
| input: string; | |
| insertion: string; | |
| nullRoot: NullLiteral | null; | |
| prettierConfigOverride: Record<string, unknown> | null; | |
| root: namedTypes.JSXElement | namedTypes.JSXFragment | null; | |
| }) => SourceEdit; | |
| export declare function resolveCompositionComponentWithFile({ environment, compositionFile, compositionId, }: { | |
| environment: CodemodEnvironment; | |
| compositionFile: string; | |
| compositionId: string; | |
| }): Promise<ResolvedCompositionComponentWithFile>; | |
| export declare const resolveCompositionComponent: ({ environment, compositionFile, compositionId, }: { | |
| environment: CodemodEnvironment; | |
| compositionFile: string; | |
| compositionId: string; | |
| }) => Promise<ResolvedCompositionComponent>; | |
| export type PipelineInsertableElement = Extract<InsertableCompositionElement, { | |
| type: 'svg' | 'composition'; | |
| }>; | |
| export declare const insertJsxElementIntoComposition: ({ compositionFile, compositionId, element, environment, from, prettierConfigOverride, wrapInSequence, }: { | |
| compositionFile: string; | |
| compositionId: string; | |
| element: InsertableCompositionElement; | |
| environment: CodemodEnvironment; | |
| from: number | null; | |
| prettierConfigOverride: Record<string, unknown> | null; | |
| wrapInSequence: { | |
| dimensions: { | |
| width: number; | |
| height: number; | |
| } | null; | |
| durationInFrames: number | null; | |
| from: number | null; | |
| name: string | null; | |
| position: InsertableCompositionElementPosition | null; | |
| } | null; | |
| }) => Promise<{ | |
| fileName: string; | |
| source: string; | |
| oldContents: string; | |
| output: string; | |
| logLine: number; | |
| nodePathRemappings: SequenceNodePathRemapping[]; | |
| insertedNodePath: SequenceNodePath | null; | |
| }>; | |
| export declare const insertJsxElementIntoProjectWithNodePathRemappings: ({ project, request, svgMarkupToJsx, wrapInSequence, }: { | |
| project: { | |
| files: Record<string, string>; | |
| rootDir: string; | |
| }; | |
| request: InsertCompositionElementRequest; | |
| svgMarkupToJsx: CodemodEnvironment['svgMarkupToJsx']; | |
| wrapInSequence: { | |
| dimensions: { | |
| width: number; | |
| height: number; | |
| } | null; | |
| durationInFrames: number | null; | |
| from: number | null; | |
| name: string | null; | |
| position: InsertableCompositionElementPosition | null; | |
| } | null; | |
| }) => Promise<{ | |
| filePath: string; | |
| insertedNodePath: SequenceNodePath | null; | |
| nodePathRemappings: SequenceNodePathRemapping[]; | |
| output: string; | |
| }>; | |
Xet Storage Details
- Size:
- 5.12 kB
- Xet hash:
- 7712b40a4a9b4a56b019f971010bd1ca81a21e635c6403cfc728545fc73f1b4d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.