sfml.js 1.1.0 → 1.3.0

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.
Files changed (113) hide show
  1. package/dist/audio/effect-processor.d.ts +1 -0
  2. package/dist/audio/input-sound-file.d.ts +1 -0
  3. package/dist/audio/output-sound-file.d.ts +1 -0
  4. package/dist/audio/output-sound-file.js +1 -0
  5. package/dist/audio/sound-buffer-recorder.d.ts +2 -0
  6. package/dist/audio/sound-buffer-recorder.js +2 -0
  7. package/dist/audio/sound-buffer.d.ts +5 -1
  8. package/dist/audio/sound-file-reader.d.ts +4 -1
  9. package/dist/audio/sound-file-reader.js +0 -9
  10. package/dist/audio/sound-recorder.d.ts +4 -0
  11. package/dist/audio/sound-recorder.js +3 -0
  12. package/dist/audio/sound-source.d.ts +2 -0
  13. package/dist/audio/sound-source.js +1 -0
  14. package/dist/graphics/blend-mode.d.ts +1 -0
  15. package/dist/graphics/boolean-vector.d.ts +6 -0
  16. package/dist/graphics/boolean-vector.js +2 -0
  17. package/dist/graphics/color.d.ts +1 -0
  18. package/dist/graphics/color.js +1 -0
  19. package/dist/graphics/font.d.ts +6 -1
  20. package/dist/graphics/font.js +1 -0
  21. package/dist/graphics/glsl.d.ts +4 -0
  22. package/dist/graphics/glyph.d.ts +1 -0
  23. package/dist/graphics/glyph.js +1 -0
  24. package/dist/graphics/image.d.ts +1 -0
  25. package/dist/graphics/rect.d.ts +4 -0
  26. package/dist/graphics/rect.js +3 -0
  27. package/dist/graphics/render-target.d.ts +2 -0
  28. package/dist/graphics/render-target.js +2 -0
  29. package/dist/graphics/render-texture.d.ts +1 -0
  30. package/dist/graphics/render-window.d.ts +1 -0
  31. package/dist/graphics/shader.d.ts +11 -5
  32. package/dist/graphics/shader.js +1 -0
  33. package/dist/graphics/shape.d.ts +12 -7
  34. package/dist/graphics/shape.js +0 -6
  35. package/dist/graphics/sprite.d.ts +5 -3
  36. package/dist/graphics/text.d.ts +32 -13
  37. package/dist/graphics/text.js +4 -0
  38. package/dist/graphics/texture.d.ts +7 -1
  39. package/dist/graphics/transform.d.ts +3 -0
  40. package/dist/graphics/transform.js +1 -0
  41. package/dist/graphics/vertex-buffer.d.ts +2 -0
  42. package/dist/graphics/vertex.d.ts +1 -0
  43. package/dist/graphics/vertex.js +1 -0
  44. package/dist/index.d.ts +4 -0
  45. package/dist/index.js +6 -3
  46. package/dist/internal/glsl-value.d.ts +3 -0
  47. package/dist/internal/glsl-value.js +3 -0
  48. package/dist/internal/scalar.d.ts +12 -6
  49. package/dist/internal/transformable.d.ts +4 -0
  50. package/dist/internal/value-storage.d.ts +85 -1
  51. package/dist/internal/value-storage.js +4 -0
  52. package/dist/network/common.d.ts +1 -0
  53. package/dist/network/http.d.ts +1 -0
  54. package/dist/network/http.js +1 -0
  55. package/dist/network/sftp.d.ts +3 -2
  56. package/dist/system/angle.d.ts +1 -0
  57. package/dist/system/angle.js +1 -0
  58. package/dist/system/operators.d.ts +8 -0
  59. package/dist/system/vector2.d.ts +6 -3
  60. package/dist/system/vector2.js +2 -0
  61. package/dist/system/vector3.d.ts +5 -3
  62. package/dist/system/vector3.js +2 -0
  63. package/dist/window/context.d.ts +1 -0
  64. package/dist/window/cursor.d.ts +1 -0
  65. package/dist/window/event.d.ts +1 -0
  66. package/dist/window/event.js +3 -1
  67. package/dist/window/window.d.ts +1 -0
  68. package/native/vertex-buffer-binding.cc +4 -4
  69. package/native/window-binding.cc +8 -2
  70. package/package.json +6 -5
  71. package/src/audio/effect-processor.ts +1 -0
  72. package/src/audio/input-sound-file.ts +1 -0
  73. package/src/audio/output-sound-file.ts +1 -0
  74. package/src/audio/sound-buffer-recorder.ts +2 -0
  75. package/src/audio/sound-buffer.ts +5 -2
  76. package/src/audio/sound-file-reader.ts +8 -0
  77. package/src/audio/sound-recorder.ts +4 -0
  78. package/src/audio/sound-source.ts +2 -0
  79. package/src/graphics/blend-mode.ts +1 -0
  80. package/src/graphics/boolean-vector.ts +6 -0
  81. package/src/graphics/color.ts +1 -0
  82. package/src/graphics/font.ts +6 -3
  83. package/src/graphics/glsl.ts +4 -0
  84. package/src/graphics/glyph.ts +1 -0
  85. package/src/graphics/image.ts +1 -0
  86. package/src/graphics/rect.ts +4 -0
  87. package/src/graphics/render-target.ts +2 -0
  88. package/src/graphics/render-texture.ts +1 -0
  89. package/src/graphics/render-window.ts +1 -0
  90. package/src/graphics/shader.ts +22 -6
  91. package/src/graphics/shape.ts +13 -6
  92. package/src/graphics/sprite.ts +5 -3
  93. package/src/graphics/text.ts +37 -13
  94. package/src/graphics/texture.ts +8 -3
  95. package/src/graphics/transform.ts +3 -0
  96. package/src/graphics/vertex-buffer.ts +2 -0
  97. package/src/graphics/vertex.ts +1 -0
  98. package/src/index.ts +4 -0
  99. package/src/internal/glsl-value.ts +3 -0
  100. package/src/internal/scalar.ts +14 -4
  101. package/src/internal/transformable.ts +4 -0
  102. package/src/internal/value-storage.ts +93 -3
  103. package/src/network/common.ts +1 -0
  104. package/src/network/http.ts +1 -0
  105. package/src/network/sftp.ts +2 -2
  106. package/src/system/angle.ts +1 -0
  107. package/src/system/operators.ts +8 -0
  108. package/src/system/vector2.ts +8 -1
  109. package/src/system/vector3.ts +9 -1
  110. package/src/window/context.ts +1 -0
  111. package/src/window/cursor.ts +1 -0
  112. package/src/window/event.ts +4 -1
  113. package/src/window/window.ts +1 -0
@@ -24,6 +24,7 @@ export interface EffectProcessorOptions extends AudioWorkerOptions {
24
24
  * 언더플로 시 무음을 출력합니다.
25
25
  */
26
26
  export declare class EffectProcessor {
27
+ /** Native worker capability. @internal */
27
28
  readonly [audioHandle]: AudioHandle<'worker'>;
28
29
  /**
29
30
  * Initialization result of the Worker effect factory.
@@ -13,6 +13,7 @@ export declare const cancelAudioInput: unique symbol;
13
13
  * @ko 호출 순서대로 16비트 인터리브 PCM을 비동기로 읽는 탐색 가능한 오디오 디코더입니다.
14
14
  */
15
15
  export declare class InputSoundFile {
16
+ /** Native input decoder capability. @internal */
16
17
  readonly [audioHandle]: AudioHandle<'input'>;
17
18
  private readonly queue;
18
19
  private u64;
@@ -10,6 +10,7 @@ import { type SoundChannel } from './value';
10
10
  * 형식은 파일 확장자로 결정됩니다.
11
11
  */
12
12
  export declare class OutputSoundFile {
13
+ /** Native output encoder capability. @internal */
13
14
  readonly [audioHandle]: import("../internal/audio-native").AudioHandle<"output">;
14
15
  private readonly queue;
15
16
  private writer?;
@@ -16,6 +16,7 @@ const audio_codec_registry_1 = require("../internal/audio-codec-registry");
16
16
  */
17
17
  class OutputSoundFile {
18
18
  constructor() {
19
+ /** Native output encoder capability. @internal */
19
20
  this[_a] = audio_native_1.audioNative.createAudioOutput();
20
21
  this.queue = new audio_native_1.AudioQueue();
21
22
  }
@@ -90,6 +90,7 @@ export declare class SoundBufferRecorder extends SoundRecorder {
90
90
  * @ko 콜백을 재정의한 하위 클래스만 큐를 활성화하며,
91
91
  * 일반 인스턴스는 Native 고속 경로를 유지합니다.
92
92
  */
93
+ /** Selects the native-buffer recording path. @internal */
93
94
  protected recorderCallbacks(): AudioRecorderCallbacks | undefined;
94
95
  /**
95
96
  * Create weak-reference dispatchers outside instance scope so idle sessions
@@ -110,5 +111,6 @@ export declare class SoundBufferRecorder extends SoundRecorder {
110
111
  * @ko 독립적인 Native 버퍼를 받습니다.
111
112
  * 이후 녹음은 이미 반환한 SoundBuffer를 수정하지 않습니다.
112
113
  */
114
+ /** Adopts the native recording result. @internal */
113
115
  protected onBuffer(buffer: AudioHandle<'bufferData'>): void;
114
116
  }
@@ -104,6 +104,7 @@ class SoundBufferRecorder extends sound_recorder_1.SoundRecorder {
104
104
  * @ko 콜백을 재정의한 하위 클래스만 큐를 활성화하며,
105
105
  * 일반 인스턴스는 Native 고속 경로를 유지합니다.
106
106
  */
107
+ /** Selects the native-buffer recording path. @internal */
107
108
  recorderCallbacks() {
108
109
  if (this.onStart === SoundBufferRecorder.prototype.onStart &&
109
110
  this.onProcessSamples ===
@@ -138,6 +139,7 @@ class SoundBufferRecorder extends sound_recorder_1.SoundRecorder {
138
139
  * @ko 독립적인 Native 버퍼를 받습니다.
139
140
  * 이후 녹음은 이미 반환한 SoundBuffer를 수정하지 않습니다.
140
141
  */
142
+ /** Adopts the native recording result. @internal */
141
143
  onBuffer(buffer) {
142
144
  this.buffer = sound_buffer_1.SoundBuffer[sound_buffer_1.adoptAudioBuffer](buffer);
143
145
  }
@@ -10,7 +10,9 @@ import { type SoundChannel, type ReadonlySamples, type ChannelMap } from './valu
10
10
  * @ko 오디오 버퍼의 읽기 전용 인터페이스입니다.
11
11
  * 샘플 뷰는 해당 네이티브 저장소를 유지합니다.
12
12
  */
13
- export type ReadonlySoundBuffer = Readonly<Pick<SoundBuffer, typeof audioHandle | 'getSamples' | 'getSampleCount' | 'getSampleRate' | 'getChannelCount' | 'getChannelMap' | 'getDuration' | 'saveToFile'>>;
13
+ export type ReadonlySoundBuffer = Readonly<Pick<SoundBuffer, 'getSamples' | 'getSampleCount' | 'getSampleRate' | 'getChannelCount' | 'getChannelMap' | 'getDuration' | 'saveToFile'>> & SoundBufferIdentity;
14
+ /** Native buffer identity retained by const references. @inline */
15
+ type SoundBufferIdentity = Pick<SoundBuffer, typeof audioHandle>;
14
16
  export declare const adoptAudioBuffer: unique symbol;
15
17
  /**
16
18
  * Views retain the exact native allocation from which they were obtained.
@@ -19,6 +21,7 @@ export declare const adoptAudioBuffer: unique symbol;
19
21
  * @ko 뷰는 자신을 얻은 원래 네이티브 메모리 할당을 그대로 유지합니다.
20
22
  */
21
23
  export declare class SoundBuffer {
24
+ /** Native audio buffer capability. @internal */
22
25
  readonly [audioHandle]: AudioHandle<'buffer'>;
23
26
  private state;
24
27
  private readonly queue;
@@ -148,3 +151,4 @@ export declare class SoundBuffer {
148
151
  private loadDecoded;
149
152
  private load;
150
153
  }
154
+ export {};
@@ -44,6 +44,7 @@ export interface SoundFileReaderInfoInput {
44
44
  * @ko 스칼라 필드가 직접 매핑된 sf::SoundFileReader::Info입니다.
45
45
  */
46
46
  export declare class SoundFileReaderInfo {
47
+ /** Native reader information capability. @internal */
47
48
  readonly [audioHandle]: AudioHandle<'readerInfo'>;
48
49
  private readonly count;
49
50
  private readonly channels;
@@ -58,7 +59,9 @@ export declare class SoundFileReaderInfo {
58
59
  * @ko 빈 형식 정보를 생성하거나 value를 복사합니다.
59
60
  * mapping은 네이티브 디코더의 내부 매핑용입니다.
60
61
  */
61
- constructor(value?: SoundFileReaderInfoInput, mapping?: AudioReaderInfoMapping);
62
+ constructor(value?: SoundFileReaderInfoInput);
63
+ /** Maps a native decoder result without copying its storage. @internal */
64
+ constructor(value: SoundFileReaderInfoInput | undefined, mapping: AudioReaderInfoMapping);
62
65
  /**
63
66
  * Total sample count across all channels.
64
67
  * @zh 所有声道合计的样本总数。
@@ -10,15 +10,6 @@ const value_1 = require("./value");
10
10
  * @ko 스칼라 필드가 직접 매핑된 sf::SoundFileReader::Info입니다.
11
11
  */
12
12
  class SoundFileReaderInfo {
13
- /**
14
- * Create empty format information or copy value; mapping is for internal
15
- * native decoder mapping.
16
- * @zh 创建空格式信息或复制 value;mapping 供原生解码器内部映射使用。
17
- * @ja 空の形式情報を作成するか value をコピーします。
18
- * mapping はネイティブデコーダー内部のマッピング用です。
19
- * @ko 빈 형식 정보를 생성하거나 value를 복사합니다.
20
- * mapping은 네이티브 디코더의 내부 매핑용입니다.
21
- */
22
13
  constructor(value, mapping = audio_native_1.audioNative.createAudioReaderInfo()) {
23
14
  this[audio_native_1.audioHandle] = mapping.handle;
24
15
  const region = (name) => {
@@ -10,7 +10,9 @@ import type { AudioWorkerOptions, AudioWorkerStats } from './worker';
10
10
  * @ko 장치 오디오를 캡처하고 Node Worker에서 16비트 인터리브 PCM을 처리합니다.
11
11
  */
12
12
  export declare class SoundRecorder {
13
+ /** Native recorder capability. @internal */
13
14
  readonly [audioHandle]: AudioHandle<'recorder'>;
15
+ /** Serializes asynchronous recorder operations. @internal */
14
16
  protected readonly queue: AudioQueue;
15
17
  private readonly values;
16
18
  private readonly options?;
@@ -172,6 +174,7 @@ export declare class SoundRecorder {
172
174
  * @ko 필요에 따라 소속 JS 스레드의 녹음 콜백을 활성화합니다.
173
175
  * 일반 Worker 녹음기는 이 파이프라인을 사용하지 않습니다.
174
176
  */
177
+ /** Retrieves the internal recording-session callbacks. @internal */
175
178
  protected recorderCallbacks(): AudioRecorderCallbacks | undefined;
176
179
  /**
177
180
  * Receive a completed native recording buffer.
@@ -179,6 +182,7 @@ export declare class SoundRecorder {
179
182
  * @ja 完成した Native 録音バッファーを受け取ります。
180
183
  * @ko 완성된 Native 녹음 버퍼를 받습니다.
181
184
  */
185
+ /** Adopts the completed native recording buffer. @internal */
182
186
  protected onBuffer(buffer: AudioHandle<'bufferData'>): void;
183
187
  private run;
184
188
  }
@@ -26,6 +26,7 @@ const cleanup = new FinalizationRegistry(session => {
26
26
  */
27
27
  class SoundRecorder {
28
28
  constructor(options, bufferRecorder = false) {
29
+ /** Serializes asynchronous recorder operations. @internal */
29
30
  this.queue = new audio_native_1.AudioQueue();
30
31
  /**
31
32
  * Stop request generation, used to cancel subclass sessions not yet started.
@@ -285,6 +286,7 @@ class SoundRecorder {
285
286
  * @ko 필요에 따라 소속 JS 스레드의 녹음 콜백을 활성화합니다.
286
287
  * 일반 Worker 녹음기는 이 파이프라인을 사용하지 않습니다.
287
288
  */
289
+ /** Retrieves the internal recording-session callbacks. @internal */
288
290
  recorderCallbacks() {
289
291
  return undefined;
290
292
  }
@@ -294,6 +296,7 @@ class SoundRecorder {
294
296
  * @ja 完成した Native 録音バッファーを受け取ります。
295
297
  * @ko 완성된 Native 녹음 버퍼를 받습니다.
296
298
  */
299
+ /** Adopts the completed native recording buffer. @internal */
297
300
  onBuffer(buffer) {
298
301
  void buffer;
299
302
  }
@@ -25,10 +25,12 @@ export declare abstract class SoundSource {
25
25
  * @ko 지향성 원뿔 설정 타입입니다.
26
26
  */
27
27
  static readonly Cone: typeof Cone;
28
+ /** Native audio source capability. @internal */
28
29
  readonly [audioHandle]: AudioHandle<'source'>;
29
30
  protected readonly values: Float32Array;
30
31
  protected readonly times: BigInt64Array;
31
32
  private effect?;
33
+ /** Initializes a native-created source mapping. @internal */
32
34
  protected constructor(mapping: AudioSourceMapping);
33
35
  /**
34
36
  * Copy source attributes, retaining this source's content and playback.
@@ -14,6 +14,7 @@ const value_1 = require("./value");
14
14
  * @ko 공유 제어 및 결과 필드이며, 모든 엔진 작업은 여전히 SFML에서 실행됩니다.
15
15
  */
16
16
  class SoundSource {
17
+ /** Initializes a native-created source mapping. @internal */
17
18
  constructor(mapping) {
18
19
  this[audio_native_1.audioHandle] = mapping.handle;
19
20
  this.values = new Float32Array(mapping.values);
@@ -119,6 +119,7 @@ export declare enum BlendEquation {
119
119
  */
120
120
  Max = 4
121
121
  }
122
+ /** Default, copy, shared-factor and separate-factor construction. @inline */
122
123
  type Arguments = [] | [source: Readonly<BlendMode>] | [
123
124
  source: BlendFactor,
124
125
  destination: BlendFactor,
@@ -10,6 +10,7 @@ import type { ScalarType } from '../internal/scalar';
10
10
  * @ko 불리언 벡터 연산의 기반 클래스입니다. 숫자 결과가 0이 아니면 true로 변환합니다.
11
11
  */
12
12
  export declare abstract class BooleanVector<K extends 'vector2' | 'vector3'> extends BooleanComponents<K> {
13
+ /** Checks dimensions before native boolean arithmetic. @internal */
13
14
  protected checkPair(rhs: R<BooleanVector<K>>): void;
14
15
  /**
15
16
  * Computes the dot product and converts it to boolean; returns true if any
@@ -26,9 +27,12 @@ export declare abstract class BooleanVector<K extends 'vector2' | 'vector3'> ext
26
27
  * @ko 성분 중 하나 이상이 true인지 반환합니다.
27
28
  */
28
29
  lengthSquared(): boolean;
30
+ /** Rejects a zero component before division. @internal */
29
31
  protected checkDivisor(rhs: R<BooleanVector<K>>): void;
30
32
  }
33
+ /** Two-dimensional source converted component by component. @inline */
31
34
  type Source2 = R<Bvec2> | R<Vector2<ScalarType>>;
35
+ /** Default, component and copy construction. @inline */
32
36
  type Arguments2 = [] | [x: boolean, y: boolean] | [source: Source2];
33
37
  /**
34
38
  * sf::Vector2<bool>; each component occupies one canonical 0/1 byte.
@@ -76,7 +80,9 @@ export declare class Bvec2 extends BooleanVector<'vector2'> {
76
80
  */
77
81
  componentWiseDiv(rhs: R<Bvec2>): Bvec2;
78
82
  }
83
+ /** Three-dimensional source converted component by component. @inline */
79
84
  type Source3 = R<Bvec3> | R<Vector3<ScalarType>>;
85
+ /** Default, component and copy construction. @inline */
80
86
  type Arguments3 = [] | [x: boolean, y: boolean, z: boolean] | [source: Source3];
81
87
  /**
82
88
  * sf::Vector3<bool>, sharing the same native family as numeric Vector3.
@@ -12,6 +12,7 @@ const vector3_1 = require("../system/vector3");
12
12
  * @ko 불리언 벡터 연산의 기반 클래스입니다. 숫자 결과가 0이 아니면 true로 변환합니다.
13
13
  */
14
14
  class BooleanVector extends glsl_value_1.BooleanComponents {
15
+ /** Checks dimensions before native boolean arithmetic. @internal */
15
16
  checkPair(rhs) {
16
17
  if (!(rhs instanceof BooleanVector) ||
17
18
  this[glsl_value_1.glslStorage].length !== rhs[glsl_value_1.glslStorage].length) {
@@ -44,6 +45,7 @@ class BooleanVector extends glsl_value_1.BooleanComponents {
44
45
  lengthSquared() {
45
46
  return this.dot(this);
46
47
  }
48
+ /** Rejects a zero component before division. @internal */
47
49
  checkDivisor(rhs) {
48
50
  this.checkPair(rhs);
49
51
  if (rhs[glsl_value_1.glslStorage].includes(0)) {
@@ -81,6 +81,7 @@ export declare class Color {
81
81
  */
82
82
  constructor(source: ReadonlyValue<Color>);
83
83
  get [colorStorage](): Uint8Array;
84
+ /** Native view of the shared RGBA bytes. @internal */
84
85
  get [colorNative](): NativeValueHandle<'color'>;
85
86
  /**
86
87
  * Red channel in the range 0 to 255. Writes convert according to Uint8Array
@@ -59,6 +59,7 @@ class Color {
59
59
  get [(_a = value_storage_1.mutableValue, value_storage_1.colorStorage)]() {
60
60
  return this.state.values;
61
61
  }
62
+ /** Native view of the shared RGBA bytes. @internal */
62
63
  get [value_storage_1.colorNative]() {
63
64
  return (0, lazy_value_1.nativeValue)(this, value_storage_1.colorNative, this.state);
64
65
  }
@@ -48,7 +48,9 @@ export declare const fontRevision: unique symbol;
48
48
  * @ja 同一フォントリソースへの読み取り専用インターフェース。フォントとグリフテクスチャの寿命を保持します。
49
49
  * @ko 동일한 글꼴 리소스의 읽기 전용 인터페이스입니다. 글꼴과 글리프 텍스처의 수명을 유지합니다.
50
50
  */
51
- export type ReadonlyFont = Readonly<Pick<Font, typeof graphicsNative | typeof fontRevision | 'getInfo' | 'getGlyph' | 'getGlyphById' | 'hasGlyph' | 'getKerning' | 'getAscent' | 'getDescent' | 'getLineSpacing' | 'getUnderlinePosition' | 'getUnderlineThickness' | 'getTexture' | 'isSmooth'>>;
51
+ export type ReadonlyFont = Readonly<Pick<Font, 'getInfo' | 'getGlyph' | 'getGlyphById' | 'hasGlyph' | 'getKerning' | 'getAscent' | 'getDescent' | 'getLineSpacing' | 'getUnderlinePosition' | 'getUnderlineThickness' | 'getTexture' | 'isSmooth'>> & FontIdentity;
52
+ /** Native identity retained by const font references. @inline */
53
+ type FontIdentity = Pick<Font, typeof graphicsNative | typeof fontRevision>;
52
54
  export declare function fontUnsigned(value: number, maximum?: number): number;
53
55
  export declare function textFloat(value: number): number;
54
56
  /**
@@ -58,7 +60,9 @@ export declare function textFloat(value: number): number;
58
60
  * @ko 네이티브가 소유하는 글꼴 페이스와 입력 저장 공간 및 유지되는 글리프 아틀라스입니다.
59
61
  */
60
62
  export declare class Font {
63
+ /** Native resource identity. @internal */
61
64
  readonly [graphicsNative]: NativeGraphicsHandle<'font'>;
65
+ /** Invalidates cached glyph geometry after font replacement. @internal */
62
66
  [fontRevision]: number;
63
67
  private state;
64
68
  private readonly textures;
@@ -197,3 +201,4 @@ export declare class Font {
197
201
  private glyph;
198
202
  private open;
199
203
  }
204
+ export {};
@@ -57,6 +57,7 @@ class Font {
57
57
  * @ko 빈 글꼴을 만들거나 기존 글꼴을 복사합니다.
58
58
  */
59
59
  constructor(source) {
60
+ /** Invalidates cached glyph geometry after font replacement. @internal */
60
61
  this[_a] = 0;
61
62
  this.textures = new Map();
62
63
  this.glyphs = new Map();
@@ -3,9 +3,12 @@ import type { ReadonlyValue as R } from '../internal/value-storage';
3
3
  import { Color } from './color';
4
4
  export { Vector2f as Vec2, Vector2i as Ivec2 } from '../system/vector2';
5
5
  export { Vector3f as Vec3, Vector3i as Ivec3 } from '../system/vector3';
6
+ export type { BooleanVector } from './boolean-vector';
6
7
  export { Bvec2, Bvec3 } from './boolean-vector';
7
8
  export { Mat3, Mat4 } from './glsl-matrix';
9
+ /** Four-dimensional source for component conversion. @inline */
8
10
  type Source4 = R<Vec4> | R<Ivec4> | R<Bvec4>;
11
+ /** Default, numeric component, color and vector construction. @inline */
9
12
  type NumericArguments = [] | [x: number, y: number, z: number, w: number] | [source: Source4 | R<Color>];
10
13
  /**
11
14
  * SFML's four-dimensional GLSL vectors expose data, not vector arithmetic.
@@ -118,6 +121,7 @@ export declare class Ivec4 extends Vector4<'i32'> {
118
121
  */
119
122
  constructor(...args: NumericArguments);
120
123
  }
124
+ /** Default, boolean component and vector construction. @inline */
121
125
  type BooleanArguments = [] | [x: boolean, y: boolean, z: boolean, w: boolean] | [source: Source4];
122
126
  /**
123
127
  * GLSL bvec4 with four boolean components.
@@ -56,6 +56,7 @@ export declare class Glyph {
56
56
  */
57
57
  constructor(source?: R<Glyph>);
58
58
  get [glyphStorage](): Uint8Array;
59
+ /** Native view of the shared glyph metadata. @internal */
59
60
  get [glyphNative](): NativeValueHandle<'glyph'>;
60
61
  /**
61
62
  * Horizontal pen advance after drawing, in pixels.
@@ -35,6 +35,7 @@ class Glyph {
35
35
  get [(_a = value_storage_1.mutableValue, value_storage_1.glyphStorage)]() {
36
36
  return this.state.values;
37
37
  }
38
+ /** Native view of the shared glyph metadata. @internal */
38
39
  get [value_storage_1.glyphNative]() {
39
40
  return (0, lazy_value_1.nativeValue)(this, value_storage_1.glyphNative, this.state);
40
41
  }
@@ -26,6 +26,7 @@ export declare let imageFromMapping: (mapping: NativeImageResource) => Image;
26
26
  * @ko 비동기 파일 및 코덱 연산을 지원하는 네이티브 소유 RGBA8 픽셀입니다.
27
27
  */
28
28
  export declare class Image {
29
+ /** Native image capability. @internal */
29
30
  readonly [graphicsNative]: NativeGraphicsHandle<'image'>;
30
31
  /**
31
32
  * Native image metadata and RGBA pixel view.
@@ -2,6 +2,7 @@ import { type NativeValueHandle } from '../internal/native';
2
2
  import { LazyValue } from '../internal/lazy-value';
3
3
  import { rectStorage, rectNative, mutableValue, type ReadonlyValue as R } from '../internal/value-storage';
4
4
  import { Vector2, Vector2i, Vector2f } from '../system/vector2';
5
+ /** Integer or floating-point rectangle coordinates. @inline */
5
6
  type RectScalar = 'i32' | 'f32';
6
7
  type RectArguments<T extends RectScalar> = [] | [source: R<Rect<RectScalar>>] | [position: R<Vector2<T>>, size: R<Vector2<T>>];
7
8
  /**
@@ -40,6 +41,7 @@ export declare class Rect<T extends RectScalar> {
40
41
  * @ko size 속성의 지연 Vector2 뷰 캐시입니다.
41
42
  */
42
43
  private sizeView?;
44
+ /** Initializes the native rectangle representation. @internal */
43
45
  protected constructor(type: T, ...args: RectArguments<T>);
44
46
  /**
45
47
  * Rectangle component type: i32 integers or f32 floating-point values.
@@ -49,6 +51,7 @@ export declare class Rect<T extends RectScalar> {
49
51
  */
50
52
  get scalarType(): T;
51
53
  get [rectStorage](): Int32Array | Float32Array;
54
+ /** Native view of the shared rectangle coordinates. @internal */
52
55
  get [rectNative](): NativeValueHandle<'rect'>;
53
56
  /**
54
57
  * Shared view of the rectangle origin; changing x/y directly changes the
@@ -104,6 +107,7 @@ export declare class Rect<T extends RectScalar> {
104
107
  * @ko 중심점 복사본을 반환합니다. 정수 사각형은 크기를 반으로 나눌 때 0 방향으로 버리는 정수 나눗셈을 사용합니다.
105
108
  */
106
109
  getCenter(): Vector2<T>;
110
+ /** Allocates an independent rectangle of the same scalar type. @internal */
107
111
  protected createResult(): Rect<T>;
108
112
  /**
109
113
  * Validates that the vector scalar type matches the rectangle.
@@ -17,6 +17,7 @@ const max = (a, b) => (a < b ? b : a);
17
17
  * @ko sf::Rect의 두 공개 특수화가 공유하는 구현입니다.
18
18
  */
19
19
  class Rect {
20
+ /** Initializes the native rectangle representation. @internal */
20
21
  constructor(type, ...args) {
21
22
  this[_a] = true;
22
23
  this.type = type;
@@ -50,6 +51,7 @@ class Rect {
50
51
  get [(_a = value_storage_1.mutableValue, value_storage_1.rectStorage)]() {
51
52
  return this.state.values;
52
53
  }
54
+ /** Native view of the shared rectangle coordinates. @internal */
53
55
  get [value_storage_1.rectNative]() {
54
56
  return (0, lazy_value_1.nativeValue)(this, value_storage_1.rectNative, this.state);
55
57
  }
@@ -164,6 +166,7 @@ class Rect {
164
166
  const y = data[1] + (0, scalar_1.toScalar)(this.type, data[3] / 2);
165
167
  return (this.type === 'f32' ? new vector2_1.Vector2f(x, y) : new vector2_1.Vector2i(x, y));
166
168
  }
169
+ /** Allocates an independent rectangle of the same scalar type. @internal */
167
170
  createResult() {
168
171
  return new Rect(this.type);
169
172
  }
@@ -205,7 +205,9 @@ export declare abstract class RenderTarget {
205
205
  [graphicsFlush](): void;
206
206
  [graphicsReads](): ReadonlySet<ReadonlyTexture>;
207
207
  [graphicsShapeReads](): ReadonlySet<object>;
208
+ /** Records native shape appearance at draw time. @internal */
208
209
  [recordShape](shape: ShapeCommandSource, states: RenderStates): void;
210
+ /** Records native sprite appearance at draw time. @internal */
209
211
  [recordSprite](sprite: SpriteCommandSource, states: RenderStates): void;
210
212
  [recordVertices](bytes: Uint8Array, type: PrimitiveType, states: RenderStates): void;
211
213
  [recordVertexBuffer](buffer: VertexBuffer, first: number, count: number, states: RenderStates): void;
@@ -299,6 +299,7 @@ class RenderTarget {
299
299
  [graphics_state_1.graphicsShapeReads]() {
300
300
  return this.pendingShapes;
301
301
  }
302
+ /** Records native shape appearance at draw time. @internal */
302
303
  [graphics_state_1.recordShape](shape, states) {
303
304
  (0, render_states_1.validateRenderStates)(states);
304
305
  const appearance = shape[graphics_state_1.shapeState];
@@ -316,6 +317,7 @@ class RenderTarget {
316
317
  this.pendingTextures.add(appearance.texture);
317
318
  }
318
319
  }
320
+ /** Records native sprite appearance at draw time. @internal */
319
321
  [graphics_state_1.recordSprite](sprite, states) {
320
322
  // Validation precedes reservation so a rejected call leaves no command.
321
323
  (0, render_states_1.validateRenderStates)(states);
@@ -19,6 +19,7 @@ export type RenderTextureSettings = ContextSettings;
19
19
  * @ko sf::RenderTexture: clear/draw를 기록하고 display 호출 시 제출합니다.
20
20
  */
21
21
  export declare class RenderTexture extends RenderTarget {
22
+ /** Native offscreen render-target capability. @internal */
22
23
  readonly [graphicsNative]: NativeGraphicsHandle<'renderTexture'>;
23
24
  private readonly state;
24
25
  private readonly targetInfo;
@@ -22,6 +22,7 @@ export interface RenderWindow extends Window {
22
22
  * @ko Window 창 작업과 RenderTarget 2차원 그리기를 모두 지원하는 창입니다.
23
23
  */
24
24
  export declare class RenderWindow extends RenderTarget {
25
+ /** Native window render-target capability. @internal */
25
26
  readonly [graphicsNative]: NativeGraphicsHandle<'window'>;
26
27
  /**
27
28
  * Native render window target handle, distinct from the Window handle.
@@ -33,16 +33,19 @@ export declare enum ShaderType {
33
33
  */
34
34
  Fragment = 2
35
35
  }
36
+ /** Accepted scalar, vector, matrix and texture uniform values. @inline */
36
37
  type Uniform = number | boolean | R<Glsl.Vec2> | R<Glsl.Vec3> | R<Glsl.Vec4> | R<Glsl.Ivec2> | R<Glsl.Ivec3> | R<Glsl.Ivec4> | R<Glsl.Bvec2> | R<Glsl.Bvec3> | R<Glsl.Bvec4> | R<Glsl.Mat3> | R<Glsl.Mat4> | ReadonlyTexture | typeof Shader.CurrentTexture;
38
+ /** Accepted element types for uniform arrays. @inline */
37
39
  type ArrayElement = number | R<Glsl.Vec2> | R<Glsl.Vec3> | R<Glsl.Vec4> | R<Glsl.Mat3> | R<Glsl.Mat4>;
38
- type Sources<T> = [T, ShaderType] | [T, T] | [T, T, T];
39
40
  /**
40
41
  * Read-only interface to the same shader program.
41
42
  * @zh 同一个着色器程序的只读接口。
42
43
  * @ja 同じシェーダープログラムへの読み取り専用インターフェース。
43
44
  * @ko 동일한 셰이더 프로그램의 읽기 전용 인터페이스입니다.
44
45
  */
45
- export type ReadonlyShader = Readonly<Pick<Shader, typeof graphicsNative | typeof shaderId | typeof shaderTextures | 'getNativeHandle'>>;
46
+ export type ReadonlyShader = Readonly<Pick<Shader, 'getNativeHandle'>> & ShaderIdentity;
47
+ /** Native identity and texture retention for const references. @inline */
48
+ type ShaderIdentity = Pick<Shader, typeof graphicsNative | typeof shaderId | typeof shaderTextures>;
46
49
  /**
47
50
  * Native-owned program; source loading and compilation run asynchronously.
48
51
  * @zh 原生层拥有的程序;源码加载和编译异步执行。
@@ -65,7 +68,9 @@ export declare class Shader {
65
68
  * @ko 그릴 때 현재 객체에 바인딩된 텍스처를 사용하는 텍스처 uniform 자리표시자입니다.
66
69
  */
67
70
  static readonly CurrentTexture: unique symbol;
71
+ /** Native program capability. @internal */
68
72
  readonly [graphicsNative]: NativeGraphicsHandle<'shader'>;
73
+ /** Recorded shader identifier. @internal */
69
74
  readonly [shaderId]: number;
70
75
  /**
71
76
  * Read-only Uint32 wrapper for the OpenGL program identifier.
@@ -88,6 +93,7 @@ export declare class Shader {
88
93
  * @ko 컴파일된 프로그램이 없는 빈 셰이더를 만듭니다.
89
94
  */
90
95
  constructor();
96
+ /** Texture references retained for recorded draws. @internal */
91
97
  get [shaderTextures](): ReadonlyMap<number, ReadonlyTexture>;
92
98
  /**
93
99
  * Compiles files asynchronously; accepts a file and stage, vertex/fragment
@@ -96,7 +102,7 @@ export declare class Shader {
96
102
  * @ja ファイルを非同期にコンパイルします。引数はファイルとステージ、頂点/フラグメントファイル、または頂点/ジオメトリ/フラグメントファイルです。
97
103
  * @ko 파일을 비동기로 컴파일합니다. 인수는 파일과 단계, 꼭짓점/프래그먼트 파일 또는 꼭짓점/기하/프래그먼트 파일입니다.
98
104
  */
99
- loadFromFile(...sources: Sources<string>): Promise<boolean>;
105
+ loadFromFile(...sources: [string, ShaderType] | [string, string] | [string, string, string]): Promise<boolean>;
100
106
  /**
101
107
  * Compiles GLSL source asynchronously; argument order matches loadFromFile.
102
108
  * Returns whether compilation and linking succeeded.
@@ -104,7 +110,7 @@ export declare class Shader {
104
110
  * @ja GLSL ソースを非同期にコンパイルします。引数順は loadFromFile と同じです。コンパイルとリンクが成功したかを返します。
105
111
  * @ko GLSL 소스를 비동기로 컴파일합니다. 인수 순서는 loadFromFile과 같으며 컴파일 및 링크 성공 여부를 반환합니다.
106
112
  */
107
- loadFromMemory(...sources: Sources<string>): Promise<boolean>;
113
+ loadFromMemory(...sources: [string, ShaderType] | [string, string] | [string, string, string]): Promise<boolean>;
108
114
  /**
109
115
  * Reads UTF-8 GLSL from input streams and compiles asynchronously; stage
110
116
  * order matches loadFromFile.
@@ -112,7 +118,7 @@ export declare class Shader {
112
118
  * @ja 入力ストリームから UTF-8 GLSL を読み、非同期にコンパイルします。ステージ順は loadFromFile と同じです。
113
119
  * @ko 입력 스트림에서 UTF-8 GLSL을 읽고 비동기로 컴파일합니다. 단계 순서는 loadFromFile과 같습니다.
114
120
  */
115
- loadFromStream(...sources: Sources<InputStream>): Promise<boolean>;
121
+ loadFromStream(...sources: [InputStream, ShaderType] | [InputStream, InputStream] | [InputStream, InputStream, InputStream]): Promise<boolean>;
116
122
  /**
117
123
  * Sets a uniform; number defaults to float. Texture arguments retain
118
124
  * references; other values are copied synchronously.
@@ -112,6 +112,7 @@ class Shader {
112
112
  this[graphics_state_1.shaderId] = mapping.id;
113
113
  this.program = new Uint32Array(mapping.buffer);
114
114
  }
115
+ /** Texture references retained for recorded draws. @internal */
115
116
  get [graphics_state_1.shaderTextures]() {
116
117
  return this.textures;
117
118
  }
@@ -20,9 +20,12 @@ export declare function shapeCount(value: number): number;
20
20
  export declare function shapeVector(value: R<Vector2f>): [number, number];
21
21
  declare class ShapeResource extends Drawable {
22
22
  readonly [mutableValue] = true;
23
+ /** Native shape capability. @internal */
23
24
  readonly [graphicsNative]: NativeGraphicsHandle<'shape'>;
25
+ /** Shared appearance and retained texture state. @internal */
24
26
  readonly [shapeState]: ShapeData;
25
27
  readonly [transformableState]: TransformableState;
28
+ /** Cached native geometry metadata. @internal */
26
29
  protected readonly shapeInfo: Readonly<NativeShapeInfo>;
27
30
  /**
28
31
  * Lazy IntRect view cache for textureRect.
@@ -39,7 +42,7 @@ declare class ShapeResource extends Drawable {
39
42
  * @ja テクスチャ参照を設定して保持します。null はテクスチャを無効にし、resetRect が true ならテクスチャ全体を使用します。
40
43
  * @ko 텍스처 참조를 설정하고 유지합니다. null은 텍스처를 비활성화하며 resetRect가 true이면 전체 텍스처를 사용합니다.
41
44
  */
42
- setTexture(this: ShapeResource, texture: ReadonlyTexture | null, resetRect?: boolean): void;
45
+ setTexture(this: Shape, texture: ReadonlyTexture | null, resetRect?: boolean): void;
43
46
  /**
44
47
  * Returns the current texture reference, or null if none is set.
45
48
  * @zh 返回当前纹理引用;未设置时为 null。
@@ -54,7 +57,7 @@ declare class ShapeResource extends Drawable {
54
57
  * @ja 使用するテクスチャのピクセル領域をコピーします。負のサイズでテクスチャを反転できます。
55
58
  * @ko 사용할 텍스처 픽셀 영역을 복사합니다. 음수 크기로 텍스처를 반전할 수 있습니다.
56
59
  */
57
- setTextureRect(this: ShapeResource, rectangle: R<IntRect>): void;
60
+ setTextureRect(this: Shape, rectangle: R<IntRect>): void;
58
61
  /**
59
62
  * Returns a view typed as read-only of the current texture pixel region.
60
63
  * @zh 返回当前纹理像素区域的只读类型视图。
@@ -68,7 +71,7 @@ declare class ShapeResource extends Drawable {
68
71
  * @ja 塗りつぶし色を設定します。描画時にテクスチャ色と乗算されます。
69
72
  * @ko 채우기 색상을 설정합니다. 그릴 때 텍스처 색상과 곱해집니다.
70
73
  */
71
- setFillColor(this: ShapeResource, color: R<Color>): void;
74
+ setFillColor(this: Shape, color: R<Color>): void;
72
75
  /**
73
76
  * Returns an independent copy of the fill color.
74
77
  * @zh 返回填充颜色的独立副本。
@@ -82,7 +85,7 @@ declare class ShapeResource extends Drawable {
82
85
  * @ja 輪郭色をコピーします。
83
86
  * @ko 윤곽선 색상을 복사합니다.
84
87
  */
85
- setOutlineColor(this: ShapeResource, color: R<Color>): void;
88
+ setOutlineColor(this: Shape, color: R<Color>): void;
86
89
  /**
87
90
  * Returns an independent copy of the outline color.
88
91
  * @zh 返回轮廓颜色的独立副本。
@@ -97,7 +100,7 @@ declare class ShapeResource extends Drawable {
97
100
  * @ja ローカル座標で輪郭の太さを設定します。正の値は外側へ、負の値は内側へ広がります。
98
101
  * @ko 로컬 좌표계의 윤곽선 두께를 설정합니다. 양수는 바깥쪽으로, 음수는 안쪽으로 확장합니다.
99
102
  */
100
- setOutlineThickness(this: ShapeResource, thickness: number): void;
103
+ setOutlineThickness(this: Shape, thickness: number): void;
101
104
  /**
102
105
  * Returns the outline thickness.
103
106
  * @zh 返回轮廓厚度。
@@ -112,7 +115,7 @@ declare class ShapeResource extends Drawable {
112
115
  * @ja 輪郭のマイター延伸と太さの最大比率を設定します。1 以上である必要があります。
113
116
  * @ko 윤곽선 마이터 연장 길이와 두께의 최대 비율을 설정합니다. 1 이상이어야 합니다.
114
117
  */
115
- setMiterLimit(this: ShapeResource, limit: number): void;
118
+ setMiterLimit(this: Shape, limit: number): void;
116
119
  /**
117
120
  * Returns the outline miter limit.
118
121
  * @zh 返回轮廓尖角延伸限制。
@@ -153,7 +156,9 @@ export declare abstract class Shape extends Shape_base {
153
156
  * @ja カスタム凸形状を作成します。サブクラスが頂点を提供し、update() を呼び出します。
154
157
  * @ko 사용자 정의 볼록 도형을 만듭니다. 하위 클래스가 꼭짓점을 제공하고 update()를 호출합니다.
155
158
  */
156
- protected constructor(init?: ShapeInit);
159
+ protected constructor();
160
+ /** Selects a native built-in shape representation. @internal */
161
+ protected constructor(init: ShapeInit);
157
162
  /**
158
163
  * Returns the outline point count.
159
164
  * @zh 返回轮廓顶点数。
@@ -249,12 +249,6 @@ class ShapeResource extends drawable_1.Drawable {
249
249
  * @ko 사용자 정의 도형은 update()를 호출하여 볼록한 꼭짓점 윤곽을 반영합니다.
250
250
  */
251
251
  class Shape extends (0, transformable_1.withTransformable)(ShapeResource) {
252
- /**
253
- * Creates a custom convex shape; subclasses provide points and call update().
254
- * @zh 创建自定义凸形状;子类提供顶点并调用 update()。
255
- * @ja カスタム凸形状を作成します。サブクラスが頂点を提供し、update() を呼び出します。
256
- * @ko 사용자 정의 볼록 도형을 만듭니다. 하위 클래스가 꼭짓점을 제공하고 update()를 호출합니다.
257
- */
258
252
  constructor(init = { kind: 0 }) {
259
253
  super(init);
260
254
  }