Rename ImporterThis and PluginThis to clearly indicate legacy status

This commit is contained in:
Natalie Weizenbaum 2021-09-30 17:47:02 -07:00
parent 2f3c06fde0
commit e0b72c11ba
8 changed files with 20 additions and 20 deletions

View File

@ -57,7 +57,7 @@ export {
types,
} from './legacy/function';
export {
ImporterThis,
LegacyImporterThis,
LegacyAsyncImporter,
LegacySyncImporter,
LegacyImporter,
@ -68,7 +68,7 @@ export {
LegacyStringOptions,
LegacyOptions,
} from './legacy/options';
export {PluginThis} from './legacy/plugin_this';
export {LegacyPluginThis} from './legacy/plugin_this';
export {LegacyResult, render, renderSync} from './legacy/render';
export const info: string;

View File

@ -1,12 +1,12 @@
import {PluginThis} from './plugin_this';
import {LegacyPluginThis} from './plugin_this';
export type LegacySyncFunction = (
this: PluginThis,
this: LegacyPluginThis,
...args: LegacyValue[]
) => LegacyValue;
export type LegacyAsyncFunction = (
this: PluginThis,
this: LegacyPluginThis,
...args: [...LegacyValue[], (type: LegacyValue) => void]
) => void;

View File

@ -1,17 +1,17 @@
import {PluginThis} from './plugin_this';
import {LegacyPluginThis} from './plugin_this';
interface ImporterThis extends PluginThis {
interface LegacyImporterThis extends LegacyPluginThis {
fromImport: boolean;
}
type LegacySyncImporter = (
this: ImporterThis,
this: LegacyImporterThis,
url: string,
prev: string
) => {file: string} | {contents: string};
type LegacyAsyncImporter = (
this: ImporterThis,
this: LegacyImporterThis,
url: string,
prev: string,
done: (data: {file: string} | {contents: string} | Error) => void

View File

@ -1,4 +1,4 @@
export interface PluginThis {
export interface LegacyPluginThis {
options: {
file?: string;

View File

@ -79,7 +79,7 @@ export {
types,
} from './legacy/function';
export {
ImporterThis,
LegacyImporterThis,
LegacyAsyncImporter,
LegacySyncImporter,
LegacyImporter,
@ -90,7 +90,7 @@ export {
LegacyStringOptions,
LegacyOptions,
} from './legacy/options';
export {PluginThis} from './legacy/plugin_this';
export {LegacyPluginThis} from './legacy/plugin_this';
export {LegacyResult, render, renderSync} from './legacy/render';
/**

View File

@ -1,12 +1,12 @@
import {PluginThis} from './plugin_this';
import {LegacyPluginThis} from './plugin_this';
export type LegacySyncFunction = (
this: PluginThis,
this: LegacyPluginThis,
...args: LegacyValue[]
) => LegacyValue;
export type LegacyAsyncFunction = (
this: PluginThis,
this: LegacyPluginThis,
...args: [...LegacyValue[], (type: LegacyValue) => void]
) => void;

View File

@ -1,10 +1,10 @@
import {PluginThis} from './plugin_this';
import {LegacyPluginThis} from './plugin_this';
/**
* The interface for the `this` keyword for custom importers. The implementation
* must invoke importers with an appropriate `this`.
*/
interface ImporterThis extends PluginThis {
interface LegacyImporterThis extends LegacyPluginThis {
/**
* `true` if this importer invocation was caused by an `@import` statement and
* `false` otherwise.
@ -16,13 +16,13 @@ interface ImporterThis extends PluginThis {
}
type LegacySyncImporter = (
this: ImporterThis,
this: LegacyImporterThis,
url: string,
prev: string
) => {file: string} | {contents: string};
type LegacyAsyncImporter = (
this: ImporterThis,
this: LegacyImporterThis,
url: string,
prev: string,
done: (data: {file: string} | {contents: string} | Error) => void

View File

@ -3,7 +3,7 @@
* functions. The implementation must invoke importers and custom functions with
* an appropriate `this`.
*/
export interface PluginThis {
export interface LegacyPluginThis {
options: {
/** The `file` option passed to the `render()` or `renderSync()` call. */
file?: string;