@fluentui/codemods
Advanced tools
Comparing version
@@ -6,10 +6,10 @@ import { SourceFile, JsxExpression, JsxOpeningElement, JsxSelfClosingElement } from 'ts-morph'; | ||
} | ||
export declare type NoOp = { | ||
export type NoOp = { | ||
logs: string[]; | ||
}; | ||
export declare type ModError = { | ||
export type ModError = { | ||
error: Error | string; | ||
}; | ||
export declare type ModFunctionResult<T> = Result<T, NoOp | ModError>; | ||
export declare type CodeModResult = Result<ModResult, NoOp | ModError>; | ||
export type ModFunctionResult<T> = Result<T, NoOp | ModError>; | ||
export type CodeModResult = Result<ModResult, NoOp | ModError>; | ||
export interface CodeMod<T = SourceFile> { | ||
@@ -42,3 +42,3 @@ /** | ||
* fine-tune upgradess. */ | ||
export declare type ValueMap<T> = { | ||
export type ValueMap<T> = { | ||
[key: string]: T; | ||
@@ -53,3 +53,3 @@ }; | ||
*/ | ||
export declare type PropTransform = (node: JsxExpression | JsxOpeningElement | JsxSelfClosingElement, toRename: string, replacementName: string) => Result<string, NoOp>; | ||
export type PropTransform = (node: JsxExpression | JsxOpeningElement | JsxSelfClosingElement, toRename: string, replacementName: string) => Result<string, NoOp>; | ||
/** | ||
@@ -71,6 +71,6 @@ * Enum that defines the cases by which this codemod can | ||
} | ||
export declare type CodeModMapType = { | ||
export type CodeModMapType = { | ||
[key: string]: (mod: any) => (file: SourceFile) => CodeModResult; | ||
}; | ||
export declare type RenamePropModType = { | ||
export type RenamePropModType = { | ||
name: string; | ||
@@ -90,3 +90,3 @@ type: 'renameProp'; | ||
}; | ||
export declare type RepathImportModType = { | ||
export type RepathImportModType = { | ||
name: string; | ||
@@ -105,3 +105,3 @@ type: 'repathImport'; | ||
}; | ||
export declare type RenameImportType = { | ||
export type RenameImportType = { | ||
name: string; | ||
@@ -119,12 +119,12 @@ type: 'renameImport'; | ||
}; | ||
export declare type ModTypes = RenamePropModType | RepathImportModType | RenameImportType; | ||
export declare type UpgradeJSONType = { | ||
export type ModTypes = RenamePropModType | RepathImportModType | RenameImportType; | ||
export type UpgradeJSONType = { | ||
name: string; | ||
upgrades: ModTypes[]; | ||
}; | ||
export declare type ModOptions = { | ||
export type ModOptions = { | ||
name: string; | ||
version: string; | ||
}; | ||
export declare type ModRunnerConfigType = { | ||
export type ModRunnerConfigType = { | ||
stringFilters: string[]; | ||
@@ -131,0 +131,0 @@ regexFilters: string[]; |
@@ -1,2 +0,2 @@ | ||
export declare type Flattened<T, V> = T extends Chainable<unknown> ? T : V; | ||
export type Flattened<T, V> = T extends Chainable<unknown> ? T : V; | ||
export interface Chainable<T> { | ||
@@ -3,0 +3,0 @@ /** |
@@ -17,3 +17,3 @@ import { Chainable, Flattened } from './chainable'; | ||
} | ||
export declare type Maybe<T> = Nothing<T> | Something<T>; | ||
export type Maybe<T> = Nothing<T> | Something<T>; | ||
export declare const Nothing: <T>() => Nothing<T>; | ||
@@ -20,0 +20,0 @@ export declare const Something: <T>(value: NonNullable<T>) => Something<T>; |
@@ -72,3 +72,3 @@ import { Chainable, Flattened } from './chainable'; | ||
*/ | ||
export declare type Result<R, E> = Err<R, E> | Ok<R, E>; | ||
export type Result<R, E> = Err<R, E> | Ok<R, E>; | ||
export declare const isOk: <R, E>(r: Result<R, E>) => r is Ok<R, E>; | ||
@@ -75,0 +75,0 @@ export declare const isErr: <R, E>(r: Result<R, E>) => r is Err<R, E>; |
{ | ||
"name": "@fluentui/codemods", | ||
"version": "8.4.23", | ||
"version": "8.4.24", | ||
"description": "Tool enabling easy upgrades to new Fluent UI versions", | ||
@@ -5,0 +5,0 @@ "main": "lib-commonjs/index.js", |
318824
-0.04%