Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion types/babel__core/babel__core-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ import * as babel from '@babel/core';
import * as t from '@babel/types';

const options: babel.TransformOptions = {
targets: {
esmodules: true,
chrome: '100',
safari: '15',
},
assumptions: {
noDocumentAll: true,
noClassCalls: true
noClassCalls: true,
},
ast: true,
sourceMaps: true,
Expand Down
78 changes: 56 additions & 22 deletions types/babel__core/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for @babel/core 7.1
// Type definitions for @babel/core 7.20
// Project: https://github.com/babel/babel/tree/master/packages/babel-core, https://babeljs.io
// Definitions by: Troy Gerwien <https://github.com/yortus>
// Marvin Hagemeister <https://github.com/marvinhagemeister>
Expand Down Expand Up @@ -360,6 +360,33 @@ export interface TransformOptions {
*/
test?: MatchPattern | MatchPattern[] | undefined;

/**
* Describes the environments you support/target for your project.
* This can either be a [browserslist-compatible](https://github.com/ai/browserslist) query (with [caveats](https://babeljs.io/docs/en/babel-preset-env#ineffective-browserslist-queries))
*
* Default: `{}`
*/
targets?:
| string
| string[]
| {
esmodules?: boolean;
node?: Omit<string, 'current'> | 'current' | true;
safari?: Omit<string, 'tp'> | 'tp';
browsers?: string | string[];
android?: string;
chrome?: string;
deno?: string;
edge?: string;
electron?: string;
firefox?: string;
ie?: string;
ios?: string;
opera?: string;
rhino?: string;
samsung?: string;
};

/**
* An optional callback that can be used to wrap visitor methods. **NOTE**: This is useful for things like introspection, and not really needed for implementing anything. Called as
* `wrapPluginVisitorMethod(pluginAlias, visitorType, callback)`.
Expand All @@ -370,7 +397,8 @@ export interface TransformOptions {
visitorType: 'enter' | 'exit',
callback: (path: NodePath, state: any) => void,
) => (path: NodePath, state: any) => void)
| null | undefined;
| null
| undefined;
}

export interface TransformCaller {
Expand Down Expand Up @@ -506,15 +534,18 @@ export interface BabelFileResult {
ast?: t.File | null | undefined;
code?: string | null | undefined;
ignored?: boolean | undefined;
map?: {
version: number;
sources: string[];
names: string[];
sourceRoot?: string | undefined;
sourcesContent?: string[] | undefined;
mappings: string;
file: string;
} | null | undefined;
map?:
| {
version: number;
sources: string[];
names: string[];
sourceRoot?: string | undefined;
sourcesContent?: string[] | undefined;
mappings: string;
file: string;
}
| null
| undefined;
metadata?: BabelFileMetadata | undefined;
}

Expand Down Expand Up @@ -637,17 +668,20 @@ export interface ConfigItem {
* Information about the plugin's file, if Babel knows it.
* *
*/
file?: {
/**
* The file that the user requested, e.g. `"@babel/env"`
*/
request: string;

/**
* The full path of the resolved file, e.g. `"/tmp/node_modules/@babel/preset-env/lib/index.js"`
*/
resolved: string;
} | null | undefined;
file?:
| {
/**
* The file that the user requested, e.g. `"@babel/env"`
*/
request: string;

/**
* The full path of the resolved file, e.g. `"/tmp/node_modules/@babel/preset-env/lib/index.js"`
*/
resolved: string;
}
| null
| undefined;
}

export type PluginOptions = object | undefined | false;
Expand Down
4 changes: 2 additions & 2 deletions types/babel__core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"dependencies": {
"@babel/parser": "^7.1.0",
"@babel/types": "^7.0.0"
"@babel/parser": "^7.20.7",
"@babel/types": "^7.20.7"
}
}