add-import

Insert an import statement into a specified file.

Example

{
  "op": "add-import",
  "targetSrc": "./src/index.ts",
  "content": "import { MyComponent } from './components/MyComponent';"
}

Fields

FieldsTypeDescription
op'add-import'Specifies the type of operation. For AddImportOperation, this field must be 'add-import'.
targetSrcstringThe path to the file where the import statement will be added.
contentstringThe import statement content to be added to the file.