@tsonic/dotnet-pure
Version:
TypeScript type definitions for .NET 10 BCL (Base Class Library) - CLR naming
160 lines (127 loc) • 7.23 kB
TypeScript
// Generated by tsbindgen - Architecture
// Namespace: System.IO.MemoryMappedFiles
// Assembly: System.IO.MemoryMappedFiles
// Branded primitive types are sourced from @tsonic/types
import type { sbyte, byte, short, ushort, int, uint, long, ulong, int128, uint128, half, float, double, decimal, nint, nuint, char } from '@tsonic/types';
// Import types from other namespaces
import type { SafeFileHandle, SafeMemoryMappedFileHandle, SafeMemoryMappedViewHandle } from "../../Microsoft.Win32.SafeHandles/internal/index.js";
import * as System_IO_Internal from "../../System.IO/internal/index.js";
import type { FileMode, FileStream, HandleInheritability, SeekOrigin, Stream, UnmanagedMemoryAccessor, UnmanagedMemoryStream } from "../../System.IO/internal/index.js";
import type { Task, Task_1, ValueTask, ValueTask_1 } from "../../System.Threading.Tasks/internal/index.js";
import type { CancellationToken } from "../../System.Threading/internal/index.js";
import * as System_Internal from "../../System/internal/index.js";
import type { AsyncCallback, Boolean as ClrBoolean, Byte, Char, Decimal, Double, Enum, IAsyncDisposable, IAsyncResult, IComparable, IConvertible, IDisposable, IFormatProvider, IFormattable, Int16, Int32, Int64, ISpanFormattable, Memory_1, Object as ClrObject, ReadOnlyMemory_1, ReadOnlySpan_1, SByte, Single, Span_1, String as ClrString, Type, TypeCode, UInt16, UInt32, UInt64, Void } from "../../System/internal/index.js";
// CLROf<T> - Maps ergonomic primitives to their CLR types for generic constraints
// This utility is used ONLY in generic type arguments to satisfy CLR interface constraints
// Value positions (parameters, return types) use lowercase primitives for ergonomics
export type CLROf<T> =
T extends sbyte ? System_Internal.SByte :
T extends short ? System_Internal.Int16 :
T extends int ? System_Internal.Int32 :
T extends long ? System_Internal.Int64 :
T extends int128 ? System_Internal.Int128 :
T extends nint ? System_Internal.IntPtr :
T extends byte ? System_Internal.Byte :
T extends ushort ? System_Internal.UInt16 :
T extends uint ? System_Internal.UInt32 :
T extends ulong ? System_Internal.UInt64 :
T extends uint128 ? System_Internal.UInt128 :
T extends nuint ? System_Internal.UIntPtr :
T extends half ? System_Internal.Half :
T extends float ? System_Internal.Single :
T extends double ? System_Internal.Double :
T extends decimal ? System_Internal.Decimal :
T extends char ? System_Internal.Char :
T extends boolean ? System_Internal.Boolean :
T extends string ? System_Internal.String :
T; // Identity fallback for non-primitive types
export enum MemoryMappedFileAccess {
ReadWrite = 0,
Read = 1,
Write = 2,
CopyOnWrite = 3,
ReadExecute = 4,
ReadWriteExecute = 5
}
export enum MemoryMappedFileOptions {
None = 0,
DelayAllocatePages = 67108864
}
export enum MemoryMappedFileRights {
CopyOnWrite = 1,
Write = 2,
Read = 4,
Execute = 8,
Delete = 65536,
ReadPermissions = 131072,
ChangePermissions = 262144,
TakeOwnership = 524288,
ReadWrite = 6,
ReadExecute = 12,
ReadWriteExecute = 14,
FullControl = 983055,
AccessSystemSecurity = 16777216
}
export interface MemoryMappedFile$instance {
readonly SafeMemoryMappedFileHandle: SafeMemoryMappedFileHandle;
CreateViewAccessor(): MemoryMappedViewAccessor;
CreateViewAccessor(offset: long, size: long): MemoryMappedViewAccessor;
CreateViewAccessor(offset: long, size: long, access: MemoryMappedFileAccess): MemoryMappedViewAccessor;
CreateViewStream(): MemoryMappedViewStream;
CreateViewStream(offset: long, size: long): MemoryMappedViewStream;
CreateViewStream(offset: long, size: long, access: MemoryMappedFileAccess): MemoryMappedViewStream;
Dispose(): void;
}
export const MemoryMappedFile: {
new(): MemoryMappedFile$instance;
CreateFromFile(fileHandle: SafeFileHandle, mapName: string, capacity: long, access: MemoryMappedFileAccess, inheritability: HandleInheritability, leaveOpen: boolean): MemoryMappedFile;
CreateFromFile(fileStream: FileStream, mapName: string, capacity: long, access: MemoryMappedFileAccess, inheritability: HandleInheritability, leaveOpen: boolean): MemoryMappedFile;
CreateFromFile(path: string, mode: FileMode, mapName: string, capacity: long, access: MemoryMappedFileAccess): MemoryMappedFile;
CreateFromFile(path: string, mode: FileMode, mapName: string, capacity: long): MemoryMappedFile;
CreateFromFile(path: string, mode: FileMode, mapName: string): MemoryMappedFile;
CreateFromFile(path: string, mode: FileMode): MemoryMappedFile;
CreateFromFile(path: string): MemoryMappedFile;
CreateNew(mapName: string, capacity: long, access: MemoryMappedFileAccess, options: MemoryMappedFileOptions, inheritability: HandleInheritability): MemoryMappedFile;
CreateNew(mapName: string, capacity: long, access: MemoryMappedFileAccess): MemoryMappedFile;
CreateNew(mapName: string, capacity: long): MemoryMappedFile;
CreateOrOpen(mapName: string, capacity: long, access: MemoryMappedFileAccess, options: MemoryMappedFileOptions, inheritability: HandleInheritability): MemoryMappedFile;
CreateOrOpen(mapName: string, capacity: long, access: MemoryMappedFileAccess): MemoryMappedFile;
CreateOrOpen(mapName: string, capacity: long): MemoryMappedFile;
OpenExisting(mapName: string, desiredAccessRights: MemoryMappedFileRights, inheritability: HandleInheritability): MemoryMappedFile;
OpenExisting(mapName: string, desiredAccessRights: MemoryMappedFileRights): MemoryMappedFile;
OpenExisting(mapName: string): MemoryMappedFile;
};
export interface __MemoryMappedFile$views {
As_IDisposable(): System_Internal.IDisposable$instance;
}
export interface MemoryMappedFile$instance extends System_Internal.IDisposable$instance {}
export type MemoryMappedFile = MemoryMappedFile$instance & __MemoryMappedFile$views;
export interface MemoryMappedViewAccessor$instance extends UnmanagedMemoryAccessor {
readonly PointerOffset: long;
readonly SafeMemoryMappedViewHandle: SafeMemoryMappedViewHandle;
Dispose(): void;
Flush(): void;
}
export const MemoryMappedViewAccessor: {
new(): MemoryMappedViewAccessor$instance;
};
export interface __MemoryMappedViewAccessor$views {
As_IDisposable(): System_Internal.IDisposable$instance;
}
export type MemoryMappedViewAccessor = MemoryMappedViewAccessor$instance & __MemoryMappedViewAccessor$views;
export interface MemoryMappedViewStream$instance extends UnmanagedMemoryStream {
readonly PointerOffset: long;
readonly SafeMemoryMappedViewHandle: SafeMemoryMappedViewHandle;
Dispose(): void;
DisposeAsync(): ValueTask;
Flush(): void;
SetLength(value: long): void;
}
export const MemoryMappedViewStream: {
new(): MemoryMappedViewStream$instance;
};
export interface __MemoryMappedViewStream$views {
As_IAsyncDisposable(): System_Internal.IAsyncDisposable$instance;
As_IDisposable(): System_Internal.IDisposable$instance;
}
export type MemoryMappedViewStream = MemoryMappedViewStream$instance & __MemoryMappedViewStream$views;