create-nx-workspace
Version:
75 lines • 2.16 kB
TypeScript
import type { CompletionMessageKey } from './messages';
/**
* Returns the flow variant for tracking (0 = preset, 1 = template).
*/
export declare function getFlowVariant(): string;
export declare const NxCloudChoices: string[];
declare const messageOptions: Record<string, MessageData[]>;
export type MessageKey = keyof typeof messageOptions;
interface MessageData {
code: string;
message: string;
initial: number;
choices: Array<{
value: string;
name: string;
}>;
footer: string;
hint?: string;
fallback?: {
value: string;
key: MessageKey;
};
completionMessage: CompletionMessageKey;
}
export declare class PromptMessages {
private selectedMessages;
getPrompt(key: MessageKey): MessageData;
codeOfSelectedPromptMessage(key: MessageKey): string;
completionMessageOfSelectedPrompt(key: MessageKey): CompletionMessageKey;
}
export declare const messages: PromptMessages;
/**
* Meta payload types for recordStat telemetry.
*/
export interface RecordStatMetaStart {
type: 'start';
[key: string]: string;
}
export interface RecordStatMetaComplete {
type: 'complete';
[key: string]: string;
}
export interface RecordStatMetaError {
type: 'error';
errorCode: string;
flowVariant: string;
errorMessage: string;
errorFile: string;
[key: string]: string;
}
export interface RecordStatMetaCancel {
type: 'cancel';
flowVariant?: string;
}
export interface RecordStatMetaPrecreate {
type: 'precreate';
flowVariant: string;
template: string;
preset: string;
nodeVersion: string;
packageManager: string;
}
export type RecordStatMeta = RecordStatMetaStart | RecordStatMetaComplete | RecordStatMetaError | RecordStatMetaCancel | RecordStatMetaPrecreate;
/**
* We are incrementing a counter to track how often create-nx-workspace is used in CI
* vs dev environments. No personal information is collected.
*/
export declare function recordStat(opts: {
command: string;
nxVersion: string;
useCloud: boolean;
meta: RecordStatMeta;
}): Promise<void>;
export {};
//# sourceMappingURL=ab-testing.d.ts.map