@farmfe/core
Version:
Farm is a extremely fast web build tool written in Rust. Farm can start a project in milliseconds and perform HMR within 10ms, making it much faster than similar tools like webpack and vite.
39 lines (38 loc) • 2.05 kB
TypeScript
/// <reference types="node" resolution-mode="require"/>
import fs from 'node:fs';
import { Config, OutputConfig } from '../types/binding.js';
export declare const FARM_TARGET_NODE_ENVS: string[];
export declare const FARM_TARGET_BROWSER_ENVS: string[];
export declare const FARM_TARGET_LIBRARY_ENVS: string[];
export declare function isObject(value: unknown): value is Record<string, unknown>;
export declare function isArray(value: unknown): value is unknown[];
export declare function isEmptyObject<T extends object>(obj: T): boolean;
export declare const isUndefined: (obj: any) => obj is undefined;
export declare const isString: (val: any) => val is string;
export declare const isNumber: (val: any) => val is number;
export declare const isEmpty: (array: any) => boolean;
export declare const isSymbol: (val: any) => val is symbol;
export declare const isWindows: boolean;
export declare function pad(source: string, n?: number): string;
export declare function clearScreen(): void;
export declare const version: any;
export declare function normalizePath(id: string): string;
export declare function normalizeBasePath(basePath: string): string;
export declare function arraify<T>(target: T | T[]): T[];
export declare function getFileSystemStats(file: string): fs.Stats | undefined;
/**
* Null or whatever
*/
export type Nullable<T> = T | null | undefined;
/**
* Array, or not yet
*/
export type ArrayAble<T> = T | Array<T>;
export declare function toArray<T>(array?: Nullable<ArrayAble<T>>): Array<T>;
export declare function mergeObjects<T extends Record<string, any>, U extends Record<string, any>>(obj1: T, obj2: U): T & U;
export declare function asyncFlatten<T>(arr: T[]): Promise<T[]>;
export declare function sleep(ms: number): Promise<unknown>;
export declare function preventExperimentalWarning(): void;
export declare function mapTargetEnvValue(config: Config['config']): void;
export declare function tryStatSync(file: string): fs.Stats | undefined;
export declare function isNodeEnv(env: OutputConfig['targetEnv']): boolean;