<commit_before>

import { Readable } from 'stream'

export interface ListFilesResult { 
  entries: string[];
  page?: string;
}

export interface ListFilesStatResult {
  entries: ListFileStatResult[];
  page?: string;
}

export interface ListFileStatResult extends Required<StatResult> {
  name: string;
  exists: true;
}

export interface PerformListFilesArgs {
  pathPrefix: string;
  page?: string;
}

export interface PerformWriteArgs { 
  path: string;
  storageTopLevel: string;
  stream: Readable;
  contentLength: number;
  contentType: string;
}

export interface PerformDeleteArgs {
  path: string;
  storageTopLevel: string;
}

export interface PerformReadArgs {
  path: string;
  storageTopLevel: string;
}

export interface ReadResult extends StatResult {
  data: Readable;
  exists: true
}

export interface PerformStatArgs {
  path: string;
  storageTopLevel: string;
}

export interface StatResult {
  exists: boolean;
  lastModifiedDate: number;
  contentLength: number;
  contentType: string;
}

export interface PerformRenameArgs {
  path: string;
  storageTopLevel: string;
  newPath: string;
}

export interface DriverModel {
  getReadURLPrefix(): string;
  performWrite(args: PerformWriteArgs): Promise<string>;
  performDelete(args: PerformDeleteArgs): Promise<void>;
  performRename(args: PerformRenameArgs): Promise<void>;
  performStat(args: PerformStatArgs): Promise<StatResult>;
  performRead(args: PerformReadArgs): Promise<ReadResult>;
  listFiles(args: PerformListFilesArgs): Promise<ListFilesResult>;
  listFilesStat(args: PerformListFilesArgs): Promise<ListFilesStatResult>;
  ensureInitialized(): Promise<void>;
  dispose(): Promise<void>;
}<commit_msg>WriteResult type with etag and update StateResult<commit_after>

import { Readable } from 'stream'

export interface ListFilesResult { 
  entries: string[];
  page?: string;
}

export interface ListFilesStatResult {
  entries: ListFileStatResult[];
  page?: string;
}

export interface ListFileStatResult extends Required<StatResult> {
  name: string;
  exists: true;
}

export interface PerformListFilesArgs {
  pathPrefix: string;
  page?: string;
}

export interface PerformWriteArgs { 
  path: string;
  storageTopLevel: string;
  stream: Readable;
  contentLength: number;
  contentType: string;
}

export interface WriteResult {
  publicURL: string;
  etag: string;
}

export interface PerformDeleteArgs {
  path: string;
  storageTopLevel: string;
}

export interface PerformReadArgs {
  path: string;
  storageTopLevel: string;
}

export interface ReadResult extends StatResult {
  data: Readable;
  exists: true
}

export interface PerformStatArgs {
  path: string;
  storageTopLevel: string;
}

export interface StatResult {
  exists: boolean;
  lastModifiedDate: number;
  etag: string;
  contentLength: number;
  contentType: string;
}

export interface PerformRenameArgs {
  path: string;
  storageTopLevel: string;
  newPath: string;
}

export interface DriverModel {
  getReadURLPrefix(): string;
  performWrite(args: PerformWriteArgs): Promise<WriteResult>;
  performDelete(args: PerformDeleteArgs): Promise<void>;
  performRename(args: PerformRenameArgs): Promise<void>;
  performStat(args: PerformStatArgs): Promise<StatResult>;
  performRead(args: PerformReadArgs): Promise<ReadResult>;
  listFiles(args: PerformListFilesArgs): Promise<ListFilesResult>;
  listFilesStat(args: PerformListFilesArgs): Promise<ListFilesStatResult>;
  ensureInitialized(): Promise<void>;
  dispose(): Promise<void>;
}
{'fraction_non_alphanumeric': 0.09366076527698458, 'fraction_numerical': 0.0, 'mean_word_length': 5.828460038986354, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '97400', 'n_tokens_mistral': 1037, 'n_tokens_neox': 1037, 'n_words': 271}