@nx.js/runtime 0.0.66 → 0.0.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +252 -250
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3693,21 +3693,6 @@ declare function queueMicrotask(callback: () => void): void;
|
|
|
3693
3693
|
* The `Switch` global object contains native interfaces to interact with the Switch hardware.
|
|
3694
3694
|
*/
|
|
3695
3695
|
declare namespace Switch {
|
|
3696
|
-
/**
|
|
3697
|
-
* A Map-like object providing methods to interact with the environment variables of the process.
|
|
3698
|
-
*
|
|
3699
|
-
* Use {@link env | `Switch.env`} to access the singleton instance of this class.
|
|
3700
|
-
*/
|
|
3701
|
-
declare class Env {
|
|
3702
|
-
/**
|
|
3703
|
-
* @private
|
|
3704
|
-
*/
|
|
3705
|
-
constructor();
|
|
3706
|
-
get(name: string): string | undefined;
|
|
3707
|
-
set(name: string, value: string): void;
|
|
3708
|
-
delete(name: string): void;
|
|
3709
|
-
toObject(): Record<string, string>;
|
|
3710
|
-
}
|
|
3711
3696
|
/**
|
|
3712
3697
|
* The `Socket` class represents a TCP connection, from which you can
|
|
3713
3698
|
* read and write data. A socket begins in a _connected_ state (if the
|
|
@@ -3755,15 +3740,20 @@ declare namespace Switch {
|
|
|
3755
3740
|
close(): void;
|
|
3756
3741
|
}
|
|
3757
3742
|
/**
|
|
3758
|
-
*
|
|
3759
|
-
*
|
|
3760
|
-
* @example
|
|
3743
|
+
* A Map-like object providing methods to interact with the environment variables of the process.
|
|
3761
3744
|
*
|
|
3762
|
-
*
|
|
3763
|
-
* const ipAddresses = await Switch.resolveDns('example.com');
|
|
3764
|
-
* ```
|
|
3745
|
+
* Use {@link env | `Switch.env`} to access the singleton instance of this class.
|
|
3765
3746
|
*/
|
|
3766
|
-
declare
|
|
3747
|
+
declare class Env {
|
|
3748
|
+
/**
|
|
3749
|
+
* @private
|
|
3750
|
+
*/
|
|
3751
|
+
constructor();
|
|
3752
|
+
get(name: string): string | undefined;
|
|
3753
|
+
set(name: string, value: string): void;
|
|
3754
|
+
delete(name: string): void;
|
|
3755
|
+
toObject(): Record<string, string>;
|
|
3756
|
+
}
|
|
3767
3757
|
interface ReadFileOptions {
|
|
3768
3758
|
/**
|
|
3769
3759
|
* Byte offset to start reading the file from.
|
|
@@ -3931,6 +3921,194 @@ declare namespace Switch {
|
|
|
3931
3921
|
stream(opts?: FsFileStreamOptions): ReadableStream<Uint8Array>;
|
|
3932
3922
|
get writable(): WritableStream<string | BufferSource>;
|
|
3933
3923
|
}
|
|
3924
|
+
/**
|
|
3925
|
+
* The `Switch.Album` class allows for interacting with the Switch's photo gallery,
|
|
3926
|
+
* providing access to the screenshots / video recordings that the user has saved.
|
|
3927
|
+
*
|
|
3928
|
+
* It is a `Set` subclass, which contains entries of
|
|
3929
|
+
* {@link AlbumFile | `Switch.AlbumFile`} instances.
|
|
3930
|
+
*
|
|
3931
|
+
* @example
|
|
3932
|
+
*
|
|
3933
|
+
* ```typescript
|
|
3934
|
+
* import { CapsAlbumStorage } from '@nx.js/constants';
|
|
3935
|
+
*
|
|
3936
|
+
* const album = new Switch.Album(CapsAlbumStorage.Sd);
|
|
3937
|
+
* for (const file of album) {
|
|
3938
|
+
* console.log(file);
|
|
3939
|
+
* }
|
|
3940
|
+
* ```
|
|
3941
|
+
*/
|
|
3942
|
+
declare class Album extends Set<AlbumFile> {
|
|
3943
|
+
readonly storage: number;
|
|
3944
|
+
constructor(storage: number);
|
|
3945
|
+
values(): SetIterator<AlbumFile>;
|
|
3946
|
+
keys(): SetIterator<AlbumFile>;
|
|
3947
|
+
entries(): SetIterator<[
|
|
3948
|
+
AlbumFile,
|
|
3949
|
+
AlbumFile
|
|
3950
|
+
]>;
|
|
3951
|
+
[Symbol.iterator](): SetIterator<AlbumFile>;
|
|
3952
|
+
}
|
|
3953
|
+
/**
|
|
3954
|
+
* Represents a file within a {@link Album | `Switch.Album`} content store,
|
|
3955
|
+
* which is either a screenshot (JPEG image) or a screen recording (MP4 movie).
|
|
3956
|
+
*
|
|
3957
|
+
* It is a subclass of `File`, so you can use familiar features like `name`,
|
|
3958
|
+
* `lastModified` and `arrayBuffer()`. It also has additional metadata like
|
|
3959
|
+
* `applicationId` to determine which application generated the contents.
|
|
3960
|
+
*
|
|
3961
|
+
* @example
|
|
3962
|
+
*
|
|
3963
|
+
* ```typescript
|
|
3964
|
+
* const ctx = screen.getContext('2d');
|
|
3965
|
+
* const buf = await file.arrayBuffer();
|
|
3966
|
+
* const img = await createImageBitmap(new Blob([buf]));
|
|
3967
|
+
* ctx.drawImage(img, 0, 0);
|
|
3968
|
+
* ```
|
|
3969
|
+
*/
|
|
3970
|
+
declare class AlbumFile extends File {
|
|
3971
|
+
/**
|
|
3972
|
+
* The ID of the application which generated the album file.
|
|
3973
|
+
*/
|
|
3974
|
+
applicationId: bigint;
|
|
3975
|
+
/**
|
|
3976
|
+
* The type of content which the album file contains. The value
|
|
3977
|
+
* corresponds with the `CapsAlbumFileContents` enum from `@nx.js/constants`.
|
|
3978
|
+
*/
|
|
3979
|
+
content: number;
|
|
3980
|
+
/**
|
|
3981
|
+
* The storage device which contains the album file. The value
|
|
3982
|
+
* corresponds with the `CapsAlbumStorage` enum from `@nx.js/constants`.
|
|
3983
|
+
*/
|
|
3984
|
+
storage: number;
|
|
3985
|
+
/**
|
|
3986
|
+
* Unique ID for when there's multiple album files with the same timestamp.
|
|
3987
|
+
*
|
|
3988
|
+
* @note The value is usually `0`.
|
|
3989
|
+
*/
|
|
3990
|
+
id: number;
|
|
3991
|
+
constructor(storage: number, id: string);
|
|
3992
|
+
text(): Promise<string>;
|
|
3993
|
+
slice(start?: number, end?: number, type?: string): Blob;
|
|
3994
|
+
stream(): ReadableStream<Uint8Array>;
|
|
3995
|
+
/**
|
|
3996
|
+
* Loads the thumbnail JPEG image for the album file.
|
|
3997
|
+
*
|
|
3998
|
+
* @example
|
|
3999
|
+
*
|
|
4000
|
+
* ```typescript
|
|
4001
|
+
* const ctx = screen.getContext('2d');
|
|
4002
|
+
* const buf = await file.thumbnail();
|
|
4003
|
+
* const img = await createImageBitmap(new Blob([buf]));
|
|
4004
|
+
* ctx.drawImage(img, 0, 0);
|
|
4005
|
+
* ```
|
|
4006
|
+
*/
|
|
4007
|
+
thumbnail(): Promise<ArrayBuffer>;
|
|
4008
|
+
}
|
|
4009
|
+
/**
|
|
4010
|
+
* Performs a DNS lookup to resolve a hostname to an array of IP addresses.
|
|
4011
|
+
*
|
|
4012
|
+
* @example
|
|
4013
|
+
*
|
|
4014
|
+
* ```typescript
|
|
4015
|
+
* const ipAddresses = await Switch.resolveDns('example.com');
|
|
4016
|
+
* ```
|
|
4017
|
+
*/
|
|
4018
|
+
declare function resolveDns(hostname: string): Promise<string[]>;
|
|
4019
|
+
declare class FileSystem {
|
|
4020
|
+
/**
|
|
4021
|
+
* A `URL` instance that points to the root of the filesystem mount.
|
|
4022
|
+
* You should use this to create file path references within
|
|
4023
|
+
* the filesystem mount.
|
|
4024
|
+
*
|
|
4025
|
+
* @example
|
|
4026
|
+
*
|
|
4027
|
+
* ```typescript
|
|
4028
|
+
* const dataUrl = new URL('data.json', fileSystem.url);
|
|
4029
|
+
* ```
|
|
4030
|
+
*/
|
|
4031
|
+
url: URL | null;
|
|
4032
|
+
/**
|
|
4033
|
+
* @private
|
|
4034
|
+
*/
|
|
4035
|
+
constructor();
|
|
4036
|
+
/**
|
|
4037
|
+
* The amount of free space available on the filesystem, in bytes.
|
|
4038
|
+
*/
|
|
4039
|
+
freeSpace(): bigint;
|
|
4040
|
+
/**
|
|
4041
|
+
* The total amount of space available on the filesystem, in bytes.
|
|
4042
|
+
*/
|
|
4043
|
+
totalSpace(): bigint;
|
|
4044
|
+
/**
|
|
4045
|
+
* Mounts the `FileSystem` such that filesystem operations may be used.
|
|
4046
|
+
*
|
|
4047
|
+
* @param name The name of the mount for filesystem paths. By default, a random name is generated. Should not exceed 31 characters, and should not have a trailing colon.
|
|
4048
|
+
*/
|
|
4049
|
+
mount(name?: string): URL;
|
|
4050
|
+
/**
|
|
4051
|
+
* Opens a file system partition specified by its `BisPartitionId`.
|
|
4052
|
+
*
|
|
4053
|
+
* @example
|
|
4054
|
+
*
|
|
4055
|
+
* ```typescript
|
|
4056
|
+
* import { BisPartitionId } from '@nx.js/constants';
|
|
4057
|
+
*
|
|
4058
|
+
* // Open and mount the "User" partition
|
|
4059
|
+
* const fs = Switch.FileSystem.openBis(BisPartitionId.User);
|
|
4060
|
+
* const url = fs.mount();
|
|
4061
|
+
*
|
|
4062
|
+
* // Read the file entries at the root of the partition
|
|
4063
|
+
* console.log(Switch.readDirSync(url));
|
|
4064
|
+
* ```
|
|
4065
|
+
*
|
|
4066
|
+
* @param id The `BisPartitionId` of the partition to open.
|
|
4067
|
+
*/
|
|
4068
|
+
static openBis(id: number): FileSystem;
|
|
4069
|
+
/**
|
|
4070
|
+
* Opens a file system partition for the SD card.
|
|
4071
|
+
*
|
|
4072
|
+
* Note that the SD card is automatically mounted under the `sdmc:` protocol,
|
|
4073
|
+
* so your application will not need to call this function under most circumstances.
|
|
4074
|
+
* However, it is useful for querying metatdata about the SD card, such as
|
|
4075
|
+
* the amount of free space available.
|
|
4076
|
+
*
|
|
4077
|
+
* @example
|
|
4078
|
+
*
|
|
4079
|
+
* ```typescript
|
|
4080
|
+
* const fs = Switch.FileSystem.openSdmc();
|
|
4081
|
+
* console.log(fs.freeSpace());
|
|
4082
|
+
* console.log(fs.totalSpace());
|
|
4083
|
+
* ```
|
|
4084
|
+
*/
|
|
4085
|
+
static openSdmc(): FileSystem;
|
|
4086
|
+
/**
|
|
4087
|
+
* Opens a file system partition for the application with the specified title ID.
|
|
4088
|
+
* The file system type is specified by the `FsFileSystemType` parameter.
|
|
4089
|
+
*
|
|
4090
|
+
* @example
|
|
4091
|
+
*
|
|
4092
|
+
* ```typescript
|
|
4093
|
+
* import { FsFileSystemType } from '@nx.js/constants';
|
|
4094
|
+
*
|
|
4095
|
+
* // Open and mount the "User" partition
|
|
4096
|
+
* const fs = Switch.FileSystem.openWithId(
|
|
4097
|
+
* 0x0100000000001000n,
|
|
4098
|
+
* FsFileSystemType.ContentMeta,
|
|
4099
|
+
* );
|
|
4100
|
+
* const url = fs.mount();
|
|
4101
|
+
*
|
|
4102
|
+
* // Read the file entries at the root of the file system
|
|
4103
|
+
* console.log(Switch.readDirSync(url));
|
|
4104
|
+
* ```
|
|
4105
|
+
*
|
|
4106
|
+
* @param titleId The title ID of the file system to open.
|
|
4107
|
+
* @param type The `FsFileSystemType` of the file system to open.
|
|
4108
|
+
* @param path The base path of the file system to open. Defaults to `/`.
|
|
4109
|
+
*/
|
|
4110
|
+
static openWithId(titleId: bigint, type: number, path?: string): FileSystem;
|
|
4111
|
+
}
|
|
3934
4112
|
interface InspectOptions {
|
|
3935
4113
|
depth?: number;
|
|
3936
4114
|
refs?: Map<{}, number>;
|
|
@@ -3951,6 +4129,56 @@ declare namespace Switch {
|
|
|
3951
4129
|
values: symbol;
|
|
3952
4130
|
entries: symbol;
|
|
3953
4131
|
};
|
|
4132
|
+
interface IRSensorInit {
|
|
4133
|
+
/**
|
|
4134
|
+
* The desired number of times per second a sample should be taken,
|
|
4135
|
+
* meaning the number of times per second that the `reading` event
|
|
4136
|
+
* will be called. A whole number or decimal may be used, the latter
|
|
4137
|
+
* for frequencies less than a second.
|
|
4138
|
+
*
|
|
4139
|
+
* @default 2
|
|
4140
|
+
*/
|
|
4141
|
+
frequency?: number;
|
|
4142
|
+
/**
|
|
4143
|
+
* CSS color that will be used when rendering the image produced by
|
|
4144
|
+
* the IR sensor.
|
|
4145
|
+
*
|
|
4146
|
+
* @default "green"
|
|
4147
|
+
*/
|
|
4148
|
+
color?: string;
|
|
4149
|
+
}
|
|
4150
|
+
/**
|
|
4151
|
+
* The `IRSensor` class reads the controller's IR (infrared) camera,
|
|
4152
|
+
* allowing the application to get the image data for each frame of
|
|
4153
|
+
* the camera.
|
|
4154
|
+
*
|
|
4155
|
+
* @example
|
|
4156
|
+
*
|
|
4157
|
+
* ```typescript
|
|
4158
|
+
* const ctx = screen.getContext('2d');
|
|
4159
|
+
*
|
|
4160
|
+
* const sensor = new Switch.IRSensor();
|
|
4161
|
+
* sensor.addEventListener('reading', () => {
|
|
4162
|
+
* ctx.drawImage(sensor.image, 0, 0);
|
|
4163
|
+
* });
|
|
4164
|
+
* sensor.start();
|
|
4165
|
+
* ```
|
|
4166
|
+
*/
|
|
4167
|
+
declare class IRSensor extends Sensor {
|
|
4168
|
+
constructor(opts?: IRSensorInit);
|
|
4169
|
+
/**
|
|
4170
|
+
* The underlying `ImageBitmap` instance containing the contents
|
|
4171
|
+
* of the IR sensor. Can be used with `ctx.drawImage()` or any
|
|
4172
|
+
* other functions that work with `ImageBitmap` instances.
|
|
4173
|
+
*/
|
|
4174
|
+
get image(): ImageBitmap;
|
|
4175
|
+
get activated(): boolean;
|
|
4176
|
+
get hasReading(): boolean;
|
|
4177
|
+
get timestamp(): number | null;
|
|
4178
|
+
start(): void;
|
|
4179
|
+
stop(): void;
|
|
4180
|
+
}
|
|
4181
|
+
declare function networkInfo(): NetworkInfo;
|
|
3954
4182
|
type ProfileUid = [
|
|
3955
4183
|
bigint,
|
|
3956
4184
|
bigint
|
|
@@ -4132,7 +4360,6 @@ declare namespace Switch {
|
|
|
4132
4360
|
static createSync(init: SaveDataCreationInfoWithNacp, nacp: ArrayBuffer): SaveData;
|
|
4133
4361
|
static [Symbol.iterator](): Generator<SaveData, void, unknown>;
|
|
4134
4362
|
}
|
|
4135
|
-
declare function networkInfo(): NetworkInfo;
|
|
4136
4363
|
/**
|
|
4137
4364
|
* Represents an installed application (game) on the console,
|
|
4138
4365
|
* or a homebrew application (`.nro` file).
|
|
@@ -4248,233 +4475,6 @@ declare namespace Switch {
|
|
|
4248
4475
|
static get self(): Application;
|
|
4249
4476
|
static [Symbol.iterator](): Generator<Application, void, unknown>;
|
|
4250
4477
|
}
|
|
4251
|
-
interface IRSensorInit {
|
|
4252
|
-
/**
|
|
4253
|
-
* The desired number of times per second a sample should be taken,
|
|
4254
|
-
* meaning the number of times per second that the `reading` event
|
|
4255
|
-
* will be called. A whole number or decimal may be used, the latter
|
|
4256
|
-
* for frequencies less than a second.
|
|
4257
|
-
*
|
|
4258
|
-
* @default 2
|
|
4259
|
-
*/
|
|
4260
|
-
frequency?: number;
|
|
4261
|
-
/**
|
|
4262
|
-
* CSS color that will be used when rendering the image produced by
|
|
4263
|
-
* the IR sensor.
|
|
4264
|
-
*
|
|
4265
|
-
* @default "green"
|
|
4266
|
-
*/
|
|
4267
|
-
color?: string;
|
|
4268
|
-
}
|
|
4269
|
-
/**
|
|
4270
|
-
* The `IRSensor` class reads the controller's IR (infrared) camera,
|
|
4271
|
-
* allowing the application to get the image data for each frame of
|
|
4272
|
-
* the camera.
|
|
4273
|
-
*
|
|
4274
|
-
* @example
|
|
4275
|
-
*
|
|
4276
|
-
* ```typescript
|
|
4277
|
-
* const ctx = screen.getContext('2d');
|
|
4278
|
-
*
|
|
4279
|
-
* const sensor = new Switch.IRSensor();
|
|
4280
|
-
* sensor.addEventListener('reading', () => {
|
|
4281
|
-
* ctx.drawImage(sensor.image, 0, 0);
|
|
4282
|
-
* });
|
|
4283
|
-
* sensor.start();
|
|
4284
|
-
* ```
|
|
4285
|
-
*/
|
|
4286
|
-
declare class IRSensor extends Sensor {
|
|
4287
|
-
constructor(opts?: IRSensorInit);
|
|
4288
|
-
/**
|
|
4289
|
-
* The underlying `ImageBitmap` instance containing the contents
|
|
4290
|
-
* of the IR sensor. Can be used with `ctx.drawImage()` or any
|
|
4291
|
-
* other functions that work with `ImageBitmap` instances.
|
|
4292
|
-
*/
|
|
4293
|
-
get image(): ImageBitmap;
|
|
4294
|
-
get activated(): boolean;
|
|
4295
|
-
get hasReading(): boolean;
|
|
4296
|
-
get timestamp(): number | null;
|
|
4297
|
-
start(): void;
|
|
4298
|
-
stop(): void;
|
|
4299
|
-
}
|
|
4300
|
-
/**
|
|
4301
|
-
* The `Switch.Album` class allows for interacting with the Switch's photo gallery,
|
|
4302
|
-
* providing access to the screenshots / video recordings that the user has saved.
|
|
4303
|
-
*
|
|
4304
|
-
* It is a `Set` subclass, which contains entries of
|
|
4305
|
-
* {@link AlbumFile | `Switch.AlbumFile`} instances.
|
|
4306
|
-
*
|
|
4307
|
-
* @example
|
|
4308
|
-
*
|
|
4309
|
-
* ```typescript
|
|
4310
|
-
* import { CapsAlbumStorage } from '@nx.js/constants';
|
|
4311
|
-
*
|
|
4312
|
-
* const album = new Switch.Album(CapsAlbumStorage.Sd);
|
|
4313
|
-
* for (const file of album) {
|
|
4314
|
-
* console.log(file);
|
|
4315
|
-
* }
|
|
4316
|
-
* ```
|
|
4317
|
-
*/
|
|
4318
|
-
declare class Album extends Set<AlbumFile> {
|
|
4319
|
-
readonly storage: number;
|
|
4320
|
-
constructor(storage: number);
|
|
4321
|
-
values(): SetIterator<AlbumFile>;
|
|
4322
|
-
keys(): SetIterator<AlbumFile>;
|
|
4323
|
-
entries(): SetIterator<[
|
|
4324
|
-
AlbumFile,
|
|
4325
|
-
AlbumFile
|
|
4326
|
-
]>;
|
|
4327
|
-
[Symbol.iterator](): SetIterator<AlbumFile>;
|
|
4328
|
-
}
|
|
4329
|
-
/**
|
|
4330
|
-
* Represents a file within a {@link Album | `Switch.Album`} content store,
|
|
4331
|
-
* which is either a screenshot (JPEG image) or a screen recording (MP4 movie).
|
|
4332
|
-
*
|
|
4333
|
-
* It is a subclass of `File`, so you can use familiar features like `name`,
|
|
4334
|
-
* `lastModified` and `arrayBuffer()`. It also has additional metadata like
|
|
4335
|
-
* `applicationId` to determine which application generated the contents.
|
|
4336
|
-
*
|
|
4337
|
-
* @example
|
|
4338
|
-
*
|
|
4339
|
-
* ```typescript
|
|
4340
|
-
* const ctx = screen.getContext('2d');
|
|
4341
|
-
* const buf = await file.arrayBuffer();
|
|
4342
|
-
* const img = await createImageBitmap(new Blob([buf]));
|
|
4343
|
-
* ctx.drawImage(img, 0, 0);
|
|
4344
|
-
* ```
|
|
4345
|
-
*/
|
|
4346
|
-
declare class AlbumFile extends File {
|
|
4347
|
-
/**
|
|
4348
|
-
* The ID of the application which generated the album file.
|
|
4349
|
-
*/
|
|
4350
|
-
applicationId: bigint;
|
|
4351
|
-
/**
|
|
4352
|
-
* The type of content which the album file contains. The value
|
|
4353
|
-
* corresponds with the `CapsAlbumFileContents` enum from `@nx.js/constants`.
|
|
4354
|
-
*/
|
|
4355
|
-
content: number;
|
|
4356
|
-
/**
|
|
4357
|
-
* The storage device which contains the album file. The value
|
|
4358
|
-
* corresponds with the `CapsAlbumStorage` enum from `@nx.js/constants`.
|
|
4359
|
-
*/
|
|
4360
|
-
storage: number;
|
|
4361
|
-
/**
|
|
4362
|
-
* Unique ID for when there's multiple album files with the same timestamp.
|
|
4363
|
-
*
|
|
4364
|
-
* @note The value is usually `0`.
|
|
4365
|
-
*/
|
|
4366
|
-
id: number;
|
|
4367
|
-
constructor(storage: number, id: string);
|
|
4368
|
-
text(): Promise<string>;
|
|
4369
|
-
slice(start?: number, end?: number, type?: string): Blob;
|
|
4370
|
-
stream(): ReadableStream<Uint8Array>;
|
|
4371
|
-
/**
|
|
4372
|
-
* Loads the thumbnail JPEG image for the album file.
|
|
4373
|
-
*
|
|
4374
|
-
* @example
|
|
4375
|
-
*
|
|
4376
|
-
* ```typescript
|
|
4377
|
-
* const ctx = screen.getContext('2d');
|
|
4378
|
-
* const buf = await file.thumbnail();
|
|
4379
|
-
* const img = await createImageBitmap(new Blob([buf]));
|
|
4380
|
-
* ctx.drawImage(img, 0, 0);
|
|
4381
|
-
* ```
|
|
4382
|
-
*/
|
|
4383
|
-
thumbnail(): Promise<ArrayBuffer>;
|
|
4384
|
-
}
|
|
4385
|
-
declare class FileSystem {
|
|
4386
|
-
/**
|
|
4387
|
-
* A `URL` instance that points to the root of the filesystem mount.
|
|
4388
|
-
* You should use this to create file path references within
|
|
4389
|
-
* the filesystem mount.
|
|
4390
|
-
*
|
|
4391
|
-
* @example
|
|
4392
|
-
*
|
|
4393
|
-
* ```typescript
|
|
4394
|
-
* const dataUrl = new URL('data.json', fileSystem.url);
|
|
4395
|
-
* ```
|
|
4396
|
-
*/
|
|
4397
|
-
url: URL | null;
|
|
4398
|
-
/**
|
|
4399
|
-
* @private
|
|
4400
|
-
*/
|
|
4401
|
-
constructor();
|
|
4402
|
-
/**
|
|
4403
|
-
* The amount of free space available on the filesystem, in bytes.
|
|
4404
|
-
*/
|
|
4405
|
-
freeSpace(): bigint;
|
|
4406
|
-
/**
|
|
4407
|
-
* The total amount of space available on the filesystem, in bytes.
|
|
4408
|
-
*/
|
|
4409
|
-
totalSpace(): bigint;
|
|
4410
|
-
/**
|
|
4411
|
-
* Mounts the `FileSystem` such that filesystem operations may be used.
|
|
4412
|
-
*
|
|
4413
|
-
* @param name The name of the mount for filesystem paths. By default, a random name is generated. Should not exceed 31 characters, and should not have a trailing colon.
|
|
4414
|
-
*/
|
|
4415
|
-
mount(name?: string): URL;
|
|
4416
|
-
/**
|
|
4417
|
-
* Opens a file system partition specified by its `BisPartitionId`.
|
|
4418
|
-
*
|
|
4419
|
-
* @example
|
|
4420
|
-
*
|
|
4421
|
-
* ```typescript
|
|
4422
|
-
* import { BisPartitionId } from '@nx.js/constants';
|
|
4423
|
-
*
|
|
4424
|
-
* // Open and mount the "User" partition
|
|
4425
|
-
* const fs = Switch.FileSystem.openBis(BisPartitionId.User);
|
|
4426
|
-
* const url = fs.mount();
|
|
4427
|
-
*
|
|
4428
|
-
* // Read the file entries at the root of the partition
|
|
4429
|
-
* console.log(Switch.readDirSync(url));
|
|
4430
|
-
* ```
|
|
4431
|
-
*
|
|
4432
|
-
* @param id The `BisPartitionId` of the partition to open.
|
|
4433
|
-
*/
|
|
4434
|
-
static openBis(id: number): FileSystem;
|
|
4435
|
-
/**
|
|
4436
|
-
* Opens a file system partition for the SD card.
|
|
4437
|
-
*
|
|
4438
|
-
* Note that the SD card is automatically mounted under the `sdmc:` protocol,
|
|
4439
|
-
* so your application will not need to call this function under most circumstances.
|
|
4440
|
-
* However, it is useful for querying metatdata about the SD card, such as
|
|
4441
|
-
* the amount of free space available.
|
|
4442
|
-
*
|
|
4443
|
-
* @example
|
|
4444
|
-
*
|
|
4445
|
-
* ```typescript
|
|
4446
|
-
* const fs = Switch.FileSystem.openSdmc();
|
|
4447
|
-
* console.log(fs.freeSpace());
|
|
4448
|
-
* console.log(fs.totalSpace());
|
|
4449
|
-
* ```
|
|
4450
|
-
*/
|
|
4451
|
-
static openSdmc(): FileSystem;
|
|
4452
|
-
/**
|
|
4453
|
-
* Opens a file system partition for the application with the specified title ID.
|
|
4454
|
-
* The file system type is specified by the `FsFileSystemType` parameter.
|
|
4455
|
-
*
|
|
4456
|
-
* @example
|
|
4457
|
-
*
|
|
4458
|
-
* ```typescript
|
|
4459
|
-
* import { FsFileSystemType } from '@nx.js/constants';
|
|
4460
|
-
*
|
|
4461
|
-
* // Open and mount the "User" partition
|
|
4462
|
-
* const fs = Switch.FileSystem.openWithId(
|
|
4463
|
-
* 0x0100000000001000n,
|
|
4464
|
-
* FsFileSystemType.ContentMeta,
|
|
4465
|
-
* );
|
|
4466
|
-
* const url = fs.mount();
|
|
4467
|
-
*
|
|
4468
|
-
* // Read the file entries at the root of the file system
|
|
4469
|
-
* console.log(Switch.readDirSync(url));
|
|
4470
|
-
* ```
|
|
4471
|
-
*
|
|
4472
|
-
* @param titleId The title ID of the file system to open.
|
|
4473
|
-
* @param type The `FsFileSystemType` of the file system to open.
|
|
4474
|
-
* @param path The base path of the file system to open. Defaults to `/`.
|
|
4475
|
-
*/
|
|
4476
|
-
static openWithId(titleId: bigint, type: number, path?: string): FileSystem;
|
|
4477
|
-
}
|
|
4478
4478
|
interface ServiceDispatchParams {
|
|
4479
4479
|
targetSession?: number;
|
|
4480
4480
|
context?: number;
|
|
@@ -4624,6 +4624,8 @@ declare namespace Switch {
|
|
|
4624
4624
|
readonly freetype2: string;
|
|
4625
4625
|
readonly harfbuzz: string;
|
|
4626
4626
|
readonly hos: string;
|
|
4627
|
+
readonly libnx: string;
|
|
4628
|
+
readonly mbedtls: string;
|
|
4627
4629
|
readonly nxjs: string;
|
|
4628
4630
|
readonly png: string;
|
|
4629
4631
|
readonly quickjs: string;
|