hikkaku 0.1.14 → 0.2.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.
- package/README.md +4 -0
- package/blocks/index.d.mts +2339 -5
- package/blocks/index.mjs +2427 -44
- package/client/index.mjs +4 -1
- package/{composer-JWWbnKkh.mjs → composer-BudVTTBs.mjs} +83 -12
- package/index.d.mts +2 -2
- package/index.mjs +73 -12
- package/package.json +7 -4
- package/project-Ca9rsVT3.d.mts +139 -0
- package/vite/index.mjs +71 -7
- package/project-BSiPw18H.d.mts +0 -73
package/blocks/index.d.mts
CHANGED
|
@@ -1,56 +1,766 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as PrimitiveSource, _ as HikkakuBlock, k as VariableReference, m as CostumeSource, w as SoundSource, y as ListReference } from "../project-Ca9rsVT3.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/blocks/control.d.ts
|
|
4
4
|
type StopOption = 'all' | 'this script' | 'other scripts in sprite' | 'other scripts in stage';
|
|
5
|
+
/**
|
|
6
|
+
* Repeats enclosed blocks a fixed number of times.
|
|
7
|
+
*
|
|
8
|
+
* Input: `times`, `handler`.
|
|
9
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
10
|
+
*
|
|
11
|
+
* @param times PrimitiveSource<number>. number of iterations
|
|
12
|
+
* @param handler () => void. body of the loop
|
|
13
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { repeat } from 'hikkaku/blocks'
|
|
17
|
+
*
|
|
18
|
+
* repeat(10, () => {})
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
5
21
|
declare const repeat: (times: PrimitiveSource<number>, handler: () => void) => HikkakuBlock;
|
|
22
|
+
/**
|
|
23
|
+
* Repeats until the condition becomes true.
|
|
24
|
+
*
|
|
25
|
+
* Input: `condition`, `handler`.
|
|
26
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
27
|
+
*
|
|
28
|
+
* @param condition PrimitiveSource<boolean>
|
|
29
|
+
* @param handler () => void
|
|
30
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* import { repeatUntil } from 'hikkaku/blocks'
|
|
34
|
+
*
|
|
35
|
+
* repeatUntil(true, () => {})
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
6
38
|
declare const repeatUntil: (condition: PrimitiveSource<boolean>, handler: () => void) => HikkakuBlock;
|
|
39
|
+
/**
|
|
40
|
+
* Repeats while the condition remains true.
|
|
41
|
+
*
|
|
42
|
+
* Input: `condition`, `handler`.
|
|
43
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
44
|
+
*
|
|
45
|
+
* @param condition PrimitiveSource<boolean>
|
|
46
|
+
* @param handler () => void
|
|
47
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* import { repeatWhile } from 'hikkaku/blocks'
|
|
51
|
+
*
|
|
52
|
+
* repeatWhile(true, () => {})
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
7
55
|
declare const repeatWhile: (condition: PrimitiveSource<boolean>, handler: () => void) => HikkakuBlock;
|
|
56
|
+
/**
|
|
57
|
+
* Loops with a loop variable.
|
|
58
|
+
*
|
|
59
|
+
* Input: `variable`, `value`, `handler`.
|
|
60
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
61
|
+
*
|
|
62
|
+
* @param variable VariableReference
|
|
63
|
+
* @param value PrimitiveSource<number>. upper bound
|
|
64
|
+
* @param handler () => void
|
|
65
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* import { forEach } from 'hikkaku/blocks'
|
|
69
|
+
*
|
|
70
|
+
* forEach(variable as any, 10, () => {})
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
8
73
|
declare const forEach: (variable: VariableReference, value: PrimitiveSource<number>, handler: () => void) => HikkakuBlock;
|
|
74
|
+
/**
|
|
75
|
+
* Infinite loop.
|
|
76
|
+
*
|
|
77
|
+
* Input: `handler`.
|
|
78
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
79
|
+
*
|
|
80
|
+
* @param handler () => void
|
|
81
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* import { forever } from 'hikkaku/blocks'
|
|
85
|
+
*
|
|
86
|
+
* forever(() => {})
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
9
89
|
declare const forever: (handler: () => void) => HikkakuBlock;
|
|
90
|
+
/**
|
|
91
|
+
* Pauses execution.
|
|
92
|
+
*
|
|
93
|
+
* Input: `seconds`.
|
|
94
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
95
|
+
*
|
|
96
|
+
* @param seconds PrimitiveSource<number>
|
|
97
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
98
|
+
* @example
|
|
99
|
+
* ```ts
|
|
100
|
+
* import { wait } from 'hikkaku/blocks'
|
|
101
|
+
*
|
|
102
|
+
* wait(10)
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
10
105
|
declare const wait: (seconds: PrimitiveSource<number>) => HikkakuBlock;
|
|
106
|
+
/**
|
|
107
|
+
* Waits until condition becomes true.
|
|
108
|
+
*
|
|
109
|
+
* Input: `condition`.
|
|
110
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
111
|
+
*
|
|
112
|
+
* @param condition PrimitiveSource<boolean>
|
|
113
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
114
|
+
* @example
|
|
115
|
+
* ```ts
|
|
116
|
+
* import { waitUntil } from 'hikkaku/blocks'
|
|
117
|
+
*
|
|
118
|
+
* waitUntil(true)
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
11
121
|
declare const waitUntil: (condition: PrimitiveSource<boolean>) => HikkakuBlock;
|
|
122
|
+
/**
|
|
123
|
+
* Conditional execution.
|
|
124
|
+
*
|
|
125
|
+
* Input: `condition`, `handler`.
|
|
126
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
127
|
+
*
|
|
128
|
+
* @param condition PrimitiveSource<boolean>
|
|
129
|
+
* @param handler () => void
|
|
130
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
131
|
+
* @example
|
|
132
|
+
* ```ts
|
|
133
|
+
* import { ifThen } from 'hikkaku/blocks'
|
|
134
|
+
*
|
|
135
|
+
* ifThen(true, () => {})
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
12
138
|
declare const ifThen: (condition: PrimitiveSource<boolean>, handler: () => void) => HikkakuBlock;
|
|
139
|
+
/**
|
|
140
|
+
* If / else branching.
|
|
141
|
+
*
|
|
142
|
+
* Input: `condition`, `thenHandler`, `elseHandler`.
|
|
143
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
144
|
+
*
|
|
145
|
+
* @param condition PrimitiveSource<boolean>
|
|
146
|
+
* @param thenHandler () => void
|
|
147
|
+
* @param elseHandler () => void
|
|
148
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
149
|
+
* @example
|
|
150
|
+
* ```ts
|
|
151
|
+
* import { ifElse } from 'hikkaku/blocks'
|
|
152
|
+
*
|
|
153
|
+
* ifElse(true, () => {}, () => {})
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
13
156
|
declare const ifElse: (condition: PrimitiveSource<boolean>, thenHandler: () => void, elseHandler: () => void) => HikkakuBlock;
|
|
157
|
+
/**
|
|
158
|
+
* Builds chained if / else-if / else branching from condition-handler pairs.
|
|
159
|
+
*
|
|
160
|
+
* Input: `branches`.
|
|
161
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
162
|
+
*
|
|
163
|
+
* @param branches Input value used by this block.
|
|
164
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
165
|
+
* @example
|
|
166
|
+
* ```ts
|
|
167
|
+
* import { match } from 'hikkaku/blocks'
|
|
168
|
+
*
|
|
169
|
+
* match(...[[true, () => {}]] as any)
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
declare const match: (...branches: [condition: PrimitiveSource<boolean>, handler: () => void][] | [...[condition: PrimitiveSource<boolean>, handler: () => void][], () => void]) => void;
|
|
173
|
+
/**
|
|
174
|
+
* Stops scripts.
|
|
175
|
+
*
|
|
176
|
+
* Input: `option`.
|
|
177
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
178
|
+
*
|
|
179
|
+
* @param option 'all' | 'this script' | 'other scripts in sprite' | 'other scripts in stage'
|
|
180
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
181
|
+
* @example
|
|
182
|
+
* ```ts
|
|
183
|
+
* import { stop } from 'hikkaku/blocks'
|
|
184
|
+
*
|
|
185
|
+
* stop('all')
|
|
186
|
+
* ```
|
|
187
|
+
*/
|
|
14
188
|
declare const stop: (option: StopOption) => HikkakuBlock;
|
|
189
|
+
/**
|
|
190
|
+
* Special menu value for cloning the current sprite.
|
|
191
|
+
*
|
|
192
|
+
* Input: none.
|
|
193
|
+
* Output: String constant used as the `target` argument of {@link createClone}.
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```ts
|
|
197
|
+
* import { CREATE_CLONE_MYSELF, createClone } from 'hikkaku/blocks'
|
|
198
|
+
*
|
|
199
|
+
* createClone(CREATE_CLONE_MYSELF)
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
15
202
|
declare const CREATE_CLONE_MYSELF = "_myself_";
|
|
203
|
+
/**
|
|
204
|
+
* Creates a clone of a target.
|
|
205
|
+
*
|
|
206
|
+
* Input: `target`.
|
|
207
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
208
|
+
*
|
|
209
|
+
* @param target string
|
|
210
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
211
|
+
* @example
|
|
212
|
+
* ```ts
|
|
213
|
+
* import { createClone } from 'hikkaku/blocks'
|
|
214
|
+
*
|
|
215
|
+
* createClone('mouse-pointer')
|
|
216
|
+
* ```
|
|
217
|
+
*/
|
|
16
218
|
declare const createClone: (target: PrimitiveSource<string>) => HikkakuBlock;
|
|
219
|
+
/**
|
|
220
|
+
* Deletes the current clone.
|
|
221
|
+
*
|
|
222
|
+
* Input: none.
|
|
223
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
224
|
+
*
|
|
225
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
226
|
+
* @example
|
|
227
|
+
* ```ts
|
|
228
|
+
* import { deleteThisClone } from 'hikkaku/blocks'
|
|
229
|
+
*
|
|
230
|
+
* deleteThisClone()
|
|
231
|
+
* ```
|
|
232
|
+
*/
|
|
17
233
|
declare const deleteThisClone: () => HikkakuBlock;
|
|
234
|
+
/**
|
|
235
|
+
* Returns the global counter value.
|
|
236
|
+
*
|
|
237
|
+
* Input: none.
|
|
238
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
239
|
+
*
|
|
240
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
241
|
+
* @example
|
|
242
|
+
* ```ts
|
|
243
|
+
* import { getCounter } from 'hikkaku/blocks'
|
|
244
|
+
*
|
|
245
|
+
* getCounter()
|
|
246
|
+
* ```
|
|
247
|
+
*/
|
|
18
248
|
declare const getCounter: () => HikkakuBlock;
|
|
249
|
+
/**
|
|
250
|
+
* Increments the counter.
|
|
251
|
+
*
|
|
252
|
+
* Input: none.
|
|
253
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
254
|
+
*
|
|
255
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
256
|
+
* @example
|
|
257
|
+
* ```ts
|
|
258
|
+
* import { incrCounter } from 'hikkaku/blocks'
|
|
259
|
+
*
|
|
260
|
+
* incrCounter()
|
|
261
|
+
* ```
|
|
262
|
+
*/
|
|
19
263
|
declare const incrCounter: () => HikkakuBlock;
|
|
264
|
+
/**
|
|
265
|
+
* Resets the counter.
|
|
266
|
+
*
|
|
267
|
+
* Input: none.
|
|
268
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
269
|
+
*
|
|
270
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
271
|
+
* @example
|
|
272
|
+
* ```ts
|
|
273
|
+
* import { clearCounter } from 'hikkaku/blocks'
|
|
274
|
+
*
|
|
275
|
+
* clearCounter()
|
|
276
|
+
* ```
|
|
277
|
+
*/
|
|
20
278
|
declare const clearCounter: () => HikkakuBlock;
|
|
279
|
+
/**
|
|
280
|
+
* Starts the script when the clone is created. You should use this to control clone behavior.
|
|
281
|
+
*
|
|
282
|
+
* Input: `stack`.
|
|
283
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
284
|
+
*
|
|
285
|
+
* @param stack Input value used by this block. Optional.
|
|
286
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
287
|
+
* @example
|
|
288
|
+
* ```ts
|
|
289
|
+
* import { controlStartAsClone } from 'hikkaku/blocks'
|
|
290
|
+
*
|
|
291
|
+
* controlStartAsClone(() => {})
|
|
292
|
+
* ```
|
|
293
|
+
*/
|
|
21
294
|
declare const controlStartAsClone: (stack?: () => void) => HikkakuBlock;
|
|
295
|
+
/**
|
|
296
|
+
* Executes enclosed blocks without screen refresh.
|
|
297
|
+
*
|
|
298
|
+
* Input: `handler`.
|
|
299
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
300
|
+
*
|
|
301
|
+
* @param handler () => void
|
|
302
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
303
|
+
* @example
|
|
304
|
+
* ```ts
|
|
305
|
+
* import { allAtOnce } from 'hikkaku/blocks'
|
|
306
|
+
*
|
|
307
|
+
* allAtOnce(() => {})
|
|
308
|
+
* ```
|
|
309
|
+
*/
|
|
22
310
|
declare const allAtOnce: (handler: () => void) => HikkakuBlock;
|
|
23
311
|
//#endregion
|
|
24
312
|
//#region src/blocks/data.d.ts
|
|
25
313
|
type ListIndex = PrimitiveSource<number | string>;
|
|
314
|
+
/**
|
|
315
|
+
* Returns the value of a variable.
|
|
316
|
+
*
|
|
317
|
+
* Input: `variable`.
|
|
318
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
319
|
+
*
|
|
320
|
+
* @param variable VariableReference
|
|
321
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
322
|
+
* @example
|
|
323
|
+
* ```ts
|
|
324
|
+
* import { getVariable } from 'hikkaku/blocks'
|
|
325
|
+
*
|
|
326
|
+
* getVariable(variable as any)
|
|
327
|
+
* ```
|
|
328
|
+
*/
|
|
26
329
|
declare const getVariable: (variable: VariableReference) => HikkakuBlock;
|
|
330
|
+
/**
|
|
331
|
+
* Sets a variable.
|
|
332
|
+
*
|
|
333
|
+
* Input: `variable`, `value`.
|
|
334
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
335
|
+
*
|
|
336
|
+
* @param variable VariableReference
|
|
337
|
+
* @param value PrimitiveSource<number | string>
|
|
338
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
339
|
+
* @example
|
|
340
|
+
* ```ts
|
|
341
|
+
* import { setVariableTo } from 'hikkaku/blocks'
|
|
342
|
+
*
|
|
343
|
+
* setVariableTo(variable as any, 10)
|
|
344
|
+
* ```
|
|
345
|
+
*/
|
|
27
346
|
declare const setVariableTo: (variable: VariableReference, value: PrimitiveSource<number | string>) => HikkakuBlock;
|
|
347
|
+
/**
|
|
348
|
+
* Changes a variable by an amount.
|
|
349
|
+
*
|
|
350
|
+
* Input: `variable`, `value`.
|
|
351
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
352
|
+
*
|
|
353
|
+
* @param variable VariableReference
|
|
354
|
+
* @param value PrimitiveSource<number>
|
|
355
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
356
|
+
* @example
|
|
357
|
+
* ```ts
|
|
358
|
+
* import { changeVariableBy } from 'hikkaku/blocks'
|
|
359
|
+
*
|
|
360
|
+
* changeVariableBy(variable as any, 10)
|
|
361
|
+
* ```
|
|
362
|
+
*/
|
|
28
363
|
declare const changeVariableBy: (variable: VariableReference, value: PrimitiveSource<number>) => HikkakuBlock;
|
|
364
|
+
/**
|
|
365
|
+
* Shows variable monitor.
|
|
366
|
+
*
|
|
367
|
+
* Input: `variable`.
|
|
368
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
369
|
+
*
|
|
370
|
+
* @param variable See function signature for accepted input values.
|
|
371
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
372
|
+
* @example
|
|
373
|
+
* ```ts
|
|
374
|
+
* import { showVariable } from 'hikkaku/blocks'
|
|
375
|
+
*
|
|
376
|
+
* showVariable(variable as any)
|
|
377
|
+
* ```
|
|
378
|
+
*/
|
|
29
379
|
declare const showVariable: (variable: VariableReference) => HikkakuBlock;
|
|
380
|
+
/**
|
|
381
|
+
* Hides variable monitor.
|
|
382
|
+
*
|
|
383
|
+
* Input: `variable`.
|
|
384
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
385
|
+
*
|
|
386
|
+
* @param variable See function signature for accepted input values.
|
|
387
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
388
|
+
* @example
|
|
389
|
+
* ```ts
|
|
390
|
+
* import { hideVariable } from 'hikkaku/blocks'
|
|
391
|
+
*
|
|
392
|
+
* hideVariable(variable as any)
|
|
393
|
+
* ```
|
|
394
|
+
*/
|
|
30
395
|
declare const hideVariable: (variable: VariableReference) => HikkakuBlock;
|
|
396
|
+
/**
|
|
397
|
+
* Returns list contents as text.
|
|
398
|
+
*
|
|
399
|
+
* Input: `list`.
|
|
400
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
401
|
+
*
|
|
402
|
+
* @param list ListReference
|
|
403
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
404
|
+
* @example
|
|
405
|
+
* ```ts
|
|
406
|
+
* import { getListContents } from 'hikkaku/blocks'
|
|
407
|
+
*
|
|
408
|
+
* getListContents(list as any)
|
|
409
|
+
* ```
|
|
410
|
+
*/
|
|
31
411
|
declare const getListContents: (list: ListReference) => HikkakuBlock;
|
|
412
|
+
/**
|
|
413
|
+
* Appends an item.
|
|
414
|
+
*
|
|
415
|
+
* Input: `list`, `item`.
|
|
416
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
417
|
+
*
|
|
418
|
+
* @param list ListReference
|
|
419
|
+
* @param item PrimitiveSource<string | number>
|
|
420
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
421
|
+
* @example
|
|
422
|
+
* ```ts
|
|
423
|
+
* import { addToList } from 'hikkaku/blocks'
|
|
424
|
+
*
|
|
425
|
+
* addToList(list as any, undefined as any)
|
|
426
|
+
* ```
|
|
427
|
+
*/
|
|
32
428
|
declare const addToList: (list: ListReference, item: PrimitiveSource<string | number>) => HikkakuBlock;
|
|
429
|
+
/**
|
|
430
|
+
* Deletes an item.
|
|
431
|
+
*
|
|
432
|
+
* Input: `list`, `index`.
|
|
433
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
434
|
+
*
|
|
435
|
+
* @param list Input value used by this block.
|
|
436
|
+
* @param index PrimitiveSource<number | string>
|
|
437
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
438
|
+
* @example
|
|
439
|
+
* ```ts
|
|
440
|
+
* import { deleteOfList } from 'hikkaku/blocks'
|
|
441
|
+
*
|
|
442
|
+
* deleteOfList(list as any, undefined as any)
|
|
443
|
+
* ```
|
|
444
|
+
*/
|
|
33
445
|
declare const deleteOfList: (list: ListReference, index: ListIndex) => HikkakuBlock;
|
|
446
|
+
/**
|
|
447
|
+
* Clears list.
|
|
448
|
+
*
|
|
449
|
+
* Input: `list`.
|
|
450
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
451
|
+
*
|
|
452
|
+
* @param list See function signature for accepted input values.
|
|
453
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
454
|
+
* @example
|
|
455
|
+
* ```ts
|
|
456
|
+
* import { deleteAllOfList } from 'hikkaku/blocks'
|
|
457
|
+
*
|
|
458
|
+
* deleteAllOfList(list as any)
|
|
459
|
+
* ```
|
|
460
|
+
*/
|
|
34
461
|
declare const deleteAllOfList: (list: ListReference) => HikkakuBlock;
|
|
462
|
+
/**
|
|
463
|
+
* Inserts item at index.
|
|
464
|
+
*
|
|
465
|
+
* Input: `list`, `index`, `item`.
|
|
466
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
467
|
+
*
|
|
468
|
+
* @param list See function signature for accepted input values.
|
|
469
|
+
* @param index See function signature for accepted input values.
|
|
470
|
+
* @param item See function signature for accepted input values.
|
|
471
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
472
|
+
* @example
|
|
473
|
+
* ```ts
|
|
474
|
+
* import { insertAtList } from 'hikkaku/blocks'
|
|
475
|
+
*
|
|
476
|
+
* insertAtList(list as any, undefined as any, undefined as any)
|
|
477
|
+
* ```
|
|
478
|
+
*/
|
|
35
479
|
declare const insertAtList: (list: ListReference, index: ListIndex, item: PrimitiveSource<string | number>) => HikkakuBlock;
|
|
480
|
+
/**
|
|
481
|
+
* Replaces item at index.
|
|
482
|
+
*
|
|
483
|
+
* Input: `list`, `index`, `item`.
|
|
484
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
485
|
+
*
|
|
486
|
+
* @param list See function signature for accepted input values.
|
|
487
|
+
* @param index See function signature for accepted input values.
|
|
488
|
+
* @param item See function signature for accepted input values.
|
|
489
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
490
|
+
* @example
|
|
491
|
+
* ```ts
|
|
492
|
+
* import { replaceItemOfList } from 'hikkaku/blocks'
|
|
493
|
+
*
|
|
494
|
+
* replaceItemOfList(list as any, undefined as any, undefined as any)
|
|
495
|
+
* ```
|
|
496
|
+
*/
|
|
36
497
|
declare const replaceItemOfList: (list: ListReference, index: ListIndex, item: PrimitiveSource<string | number>) => HikkakuBlock;
|
|
498
|
+
/**
|
|
499
|
+
* Returns list item.
|
|
500
|
+
*
|
|
501
|
+
* Input: `list`, `index`.
|
|
502
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
503
|
+
*
|
|
504
|
+
* @param list See function signature for accepted input values.
|
|
505
|
+
* @param index See function signature for accepted input values.
|
|
506
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
507
|
+
* @example
|
|
508
|
+
* ```ts
|
|
509
|
+
* import { getItemOfList } from 'hikkaku/blocks'
|
|
510
|
+
*
|
|
511
|
+
* getItemOfList(list as any, undefined as any)
|
|
512
|
+
* ```
|
|
513
|
+
*/
|
|
37
514
|
declare const getItemOfList: (list: ListReference, index: ListIndex) => HikkakuBlock;
|
|
515
|
+
/**
|
|
516
|
+
* Returns index of item.
|
|
517
|
+
*
|
|
518
|
+
* Input: `list`, `item`.
|
|
519
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
520
|
+
*
|
|
521
|
+
* @param list See function signature for accepted input values.
|
|
522
|
+
* @param item See function signature for accepted input values.
|
|
523
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
524
|
+
* @example
|
|
525
|
+
* ```ts
|
|
526
|
+
* import { getItemNumOfList } from 'hikkaku/blocks'
|
|
527
|
+
*
|
|
528
|
+
* getItemNumOfList(list as any, undefined as any)
|
|
529
|
+
* ```
|
|
530
|
+
*/
|
|
38
531
|
declare const getItemNumOfList: (list: ListReference, item: PrimitiveSource<string | number>) => HikkakuBlock;
|
|
532
|
+
/**
|
|
533
|
+
* Returns list length.
|
|
534
|
+
*
|
|
535
|
+
* Input: `list`.
|
|
536
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
537
|
+
*
|
|
538
|
+
* @param list See function signature for accepted input values.
|
|
539
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
540
|
+
* @example
|
|
541
|
+
* ```ts
|
|
542
|
+
* import { lengthOfList } from 'hikkaku/blocks'
|
|
543
|
+
*
|
|
544
|
+
* lengthOfList(list as any)
|
|
545
|
+
* ```
|
|
546
|
+
*/
|
|
39
547
|
declare const lengthOfList: (list: ListReference) => HikkakuBlock;
|
|
548
|
+
/**
|
|
549
|
+
* Checks membership.
|
|
550
|
+
*
|
|
551
|
+
* Input: `list`, `item`.
|
|
552
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
553
|
+
*
|
|
554
|
+
* @param list See function signature for accepted input values.
|
|
555
|
+
* @param item See function signature for accepted input values.
|
|
556
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
557
|
+
* @example
|
|
558
|
+
* ```ts
|
|
559
|
+
* import { listContainsItem } from 'hikkaku/blocks'
|
|
560
|
+
*
|
|
561
|
+
* listContainsItem(list as any, undefined as any)
|
|
562
|
+
* ```
|
|
563
|
+
*/
|
|
40
564
|
declare const listContainsItem: (list: ListReference, item: PrimitiveSource<string | number>) => HikkakuBlock;
|
|
565
|
+
/**
|
|
566
|
+
* Shows list monitor.
|
|
567
|
+
*
|
|
568
|
+
* Input: `list`.
|
|
569
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
570
|
+
*
|
|
571
|
+
* @param list See function signature for accepted input values.
|
|
572
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
573
|
+
* @example
|
|
574
|
+
* ```ts
|
|
575
|
+
* import { showList } from 'hikkaku/blocks'
|
|
576
|
+
*
|
|
577
|
+
* showList(list as any)
|
|
578
|
+
* ```
|
|
579
|
+
*/
|
|
41
580
|
declare const showList: (list: ListReference) => HikkakuBlock;
|
|
581
|
+
/**
|
|
582
|
+
* Hides list monitor.
|
|
583
|
+
*
|
|
584
|
+
* Input: `list`.
|
|
585
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
586
|
+
*
|
|
587
|
+
* @param list See function signature for accepted input values.
|
|
588
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
589
|
+
* @example
|
|
590
|
+
* ```ts
|
|
591
|
+
* import { hideList } from 'hikkaku/blocks'
|
|
592
|
+
*
|
|
593
|
+
* hideList(list as any)
|
|
594
|
+
* ```
|
|
595
|
+
*/
|
|
42
596
|
declare const hideList: (list: ListReference) => HikkakuBlock;
|
|
43
597
|
//#endregion
|
|
44
598
|
//#region src/blocks/events.d.ts
|
|
599
|
+
/**
|
|
600
|
+
* Runs when green flag is clicked.
|
|
601
|
+
*
|
|
602
|
+
* Input: `stack`.
|
|
603
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
604
|
+
*
|
|
605
|
+
* @param stack () => void Optional.
|
|
606
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
607
|
+
* @example
|
|
608
|
+
* ```ts
|
|
609
|
+
* import { whenFlagClicked } from 'hikkaku/blocks'
|
|
610
|
+
*
|
|
611
|
+
* whenFlagClicked(() => {})
|
|
612
|
+
* ```
|
|
613
|
+
*/
|
|
45
614
|
declare const whenFlagClicked: (stack?: () => void) => HikkakuBlock;
|
|
615
|
+
/**
|
|
616
|
+
* Runs when key is pressed.
|
|
617
|
+
*
|
|
618
|
+
* Input: `key`, `stack`.
|
|
619
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
620
|
+
*
|
|
621
|
+
* @param key string
|
|
622
|
+
* @param stack Input value used by this block. Optional.
|
|
623
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
624
|
+
* @example
|
|
625
|
+
* ```ts
|
|
626
|
+
* import { whenKeyPressed } from 'hikkaku/blocks'
|
|
627
|
+
*
|
|
628
|
+
* whenKeyPressed('space', () => {})
|
|
629
|
+
* ```
|
|
630
|
+
*/
|
|
46
631
|
declare const whenKeyPressed: (key: string, stack?: () => void) => HikkakuBlock;
|
|
632
|
+
/**
|
|
633
|
+
* Runs when sprite is clicked.
|
|
634
|
+
*
|
|
635
|
+
* Input: `stack`.
|
|
636
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
637
|
+
*
|
|
638
|
+
* @param stack See function signature for accepted input values. Optional.
|
|
639
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
640
|
+
* @example
|
|
641
|
+
* ```ts
|
|
642
|
+
* import { whenThisSpriteClicked } from 'hikkaku/blocks'
|
|
643
|
+
*
|
|
644
|
+
* whenThisSpriteClicked(() => {})
|
|
645
|
+
* ```
|
|
646
|
+
*/
|
|
47
647
|
declare const whenThisSpriteClicked: (stack?: () => void) => HikkakuBlock;
|
|
648
|
+
/**
|
|
649
|
+
* Runs when stage is clicked.
|
|
650
|
+
*
|
|
651
|
+
* Input: `stack`.
|
|
652
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
653
|
+
*
|
|
654
|
+
* @param stack See function signature for accepted input values. Optional.
|
|
655
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
656
|
+
* @example
|
|
657
|
+
* ```ts
|
|
658
|
+
* import { whenStageClicked } from 'hikkaku/blocks'
|
|
659
|
+
*
|
|
660
|
+
* whenStageClicked(() => {})
|
|
661
|
+
* ```
|
|
662
|
+
*/
|
|
48
663
|
declare const whenStageClicked: (stack?: () => void) => HikkakuBlock;
|
|
664
|
+
/**
|
|
665
|
+
* Runs when backdrop changes.
|
|
666
|
+
*
|
|
667
|
+
* Input: `backdrop`, `stack`.
|
|
668
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
669
|
+
*
|
|
670
|
+
* @param backdrop See function signature for accepted input values.
|
|
671
|
+
* @param stack See function signature for accepted input values. Optional.
|
|
672
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
673
|
+
* @example
|
|
674
|
+
* ```ts
|
|
675
|
+
* import { whenBackdropSwitchesTo } from 'hikkaku/blocks'
|
|
676
|
+
*
|
|
677
|
+
* whenBackdropSwitchesTo('backdrop1', () => {})
|
|
678
|
+
* ```
|
|
679
|
+
*/
|
|
49
680
|
declare const whenBackdropSwitchesTo: (backdrop: string, stack?: () => void) => HikkakuBlock;
|
|
681
|
+
/**
|
|
682
|
+
* Runs when a broadcast is received.
|
|
683
|
+
*
|
|
684
|
+
* Input: `broadcast`, `stack`.
|
|
685
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
686
|
+
*
|
|
687
|
+
* @param broadcast See function signature for accepted input values.
|
|
688
|
+
* @param stack See function signature for accepted input values. Optional.
|
|
689
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
690
|
+
* @example
|
|
691
|
+
* ```ts
|
|
692
|
+
* import { whenBroadcastReceived } from 'hikkaku/blocks'
|
|
693
|
+
*
|
|
694
|
+
* whenBroadcastReceived('message1', () => {})
|
|
695
|
+
* ```
|
|
696
|
+
*/
|
|
50
697
|
declare const whenBroadcastReceived: (broadcast: string, stack?: () => void) => HikkakuBlock;
|
|
698
|
+
/**
|
|
699
|
+
* Runs when touching object.
|
|
700
|
+
*
|
|
701
|
+
* Input: `target`, `stack`.
|
|
702
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
703
|
+
*
|
|
704
|
+
* @param target See function signature for accepted input values.
|
|
705
|
+
* @param stack See function signature for accepted input values. Optional.
|
|
706
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
707
|
+
* @example
|
|
708
|
+
* ```ts
|
|
709
|
+
* import { whenTouchingObject } from 'hikkaku/blocks'
|
|
710
|
+
*
|
|
711
|
+
* whenTouchingObject('mouse-pointer', () => {})
|
|
712
|
+
* ```
|
|
713
|
+
*/
|
|
51
714
|
declare const whenTouchingObject: (target: string, stack?: () => void) => HikkakuBlock;
|
|
715
|
+
/**
|
|
716
|
+
* Triggered by sensor threshold.
|
|
717
|
+
*
|
|
718
|
+
* Input: `menu`, `value`, `stack`.
|
|
719
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
720
|
+
*
|
|
721
|
+
* @param menu See function signature for accepted input values.
|
|
722
|
+
* @param value See function signature for accepted input values.
|
|
723
|
+
* @param stack See function signature for accepted input values. Optional.
|
|
724
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
725
|
+
* @example
|
|
726
|
+
* ```ts
|
|
727
|
+
* import { whenGreaterThan } from 'hikkaku/blocks'
|
|
728
|
+
*
|
|
729
|
+
* whenGreaterThan('loudness', 10, () => {})
|
|
730
|
+
* ```
|
|
731
|
+
*/
|
|
52
732
|
declare const whenGreaterThan: (menu: string, value: PrimitiveSource<number>, stack?: () => void) => HikkakuBlock;
|
|
733
|
+
/**
|
|
734
|
+
* Sends a broadcast.
|
|
735
|
+
*
|
|
736
|
+
* Input: `message`.
|
|
737
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
738
|
+
*
|
|
739
|
+
* @param message See function signature for accepted input values.
|
|
740
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
741
|
+
* @example
|
|
742
|
+
* ```ts
|
|
743
|
+
* import { broadcast } from 'hikkaku/blocks'
|
|
744
|
+
*
|
|
745
|
+
* broadcast('Hello')
|
|
746
|
+
* ```
|
|
747
|
+
*/
|
|
53
748
|
declare const broadcast: (message: PrimitiveSource<string>) => HikkakuBlock;
|
|
749
|
+
/**
|
|
750
|
+
* Broadcasts and waits.
|
|
751
|
+
*
|
|
752
|
+
* Input: `message`.
|
|
753
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
754
|
+
*
|
|
755
|
+
* @param message See function signature for accepted input values.
|
|
756
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
757
|
+
* @example
|
|
758
|
+
* ```ts
|
|
759
|
+
* import { broadcastAndWait } from 'hikkaku/blocks'
|
|
760
|
+
*
|
|
761
|
+
* broadcastAndWait('Hello')
|
|
762
|
+
* ```
|
|
763
|
+
*/
|
|
54
764
|
declare const broadcastAndWait: (message: PrimitiveSource<string>) => HikkakuBlock;
|
|
55
765
|
//#endregion
|
|
56
766
|
//#region src/blocks/looks.d.ts
|
|
@@ -58,85 +768,1174 @@ type LookEffect = 'color' | 'fisheye' | 'whirl' | 'pixelate' | 'mosaic' | 'brigh
|
|
|
58
768
|
type FrontBack = 'front' | 'back';
|
|
59
769
|
type ForwardBackward = 'forward' | 'backward';
|
|
60
770
|
type NumberName = 'number' | 'name';
|
|
771
|
+
/**
|
|
772
|
+
* Displays a speech bubble.
|
|
773
|
+
*
|
|
774
|
+
* Input: `message`.
|
|
775
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
776
|
+
*
|
|
777
|
+
* @param message See function signature for accepted input values.
|
|
778
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
779
|
+
* @example
|
|
780
|
+
* ```ts
|
|
781
|
+
* import { say } from 'hikkaku/blocks'
|
|
782
|
+
*
|
|
783
|
+
* say('Hello')
|
|
784
|
+
* ```
|
|
785
|
+
*/
|
|
61
786
|
declare const say: (message: PrimitiveSource<string>) => HikkakuBlock;
|
|
787
|
+
/**
|
|
788
|
+
* Speaks for duration.
|
|
789
|
+
*
|
|
790
|
+
* Input: `message`, `seconds`.
|
|
791
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
792
|
+
*
|
|
793
|
+
* @param message See function signature for accepted input values.
|
|
794
|
+
* @param seconds See function signature for accepted input values.
|
|
795
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
796
|
+
* @example
|
|
797
|
+
* ```ts
|
|
798
|
+
* import { sayForSecs } from 'hikkaku/blocks'
|
|
799
|
+
*
|
|
800
|
+
* sayForSecs('Hello', 10)
|
|
801
|
+
* ```
|
|
802
|
+
*/
|
|
62
803
|
declare const sayForSecs: (message: PrimitiveSource<string>, seconds: PrimitiveSource<number>) => HikkakuBlock;
|
|
804
|
+
/**
|
|
805
|
+
* Displays thought bubble.
|
|
806
|
+
*
|
|
807
|
+
* Input: `message`.
|
|
808
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
809
|
+
*
|
|
810
|
+
* @param message See function signature for accepted input values.
|
|
811
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
812
|
+
* @example
|
|
813
|
+
* ```ts
|
|
814
|
+
* import { think } from 'hikkaku/blocks'
|
|
815
|
+
*
|
|
816
|
+
* think('Hello')
|
|
817
|
+
* ```
|
|
818
|
+
*/
|
|
63
819
|
declare const think: (message: PrimitiveSource<string>) => HikkakuBlock;
|
|
820
|
+
/**
|
|
821
|
+
* Thinks for duration.
|
|
822
|
+
*
|
|
823
|
+
* Input: `message`, `seconds`.
|
|
824
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
825
|
+
*
|
|
826
|
+
* @param message See function signature for accepted input values.
|
|
827
|
+
* @param seconds See function signature for accepted input values.
|
|
828
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
829
|
+
* @example
|
|
830
|
+
* ```ts
|
|
831
|
+
* import { thinkForSecs } from 'hikkaku/blocks'
|
|
832
|
+
*
|
|
833
|
+
* thinkForSecs('Hello', 10)
|
|
834
|
+
* ```
|
|
835
|
+
*/
|
|
64
836
|
declare const thinkForSecs: (message: PrimitiveSource<string>, seconds: PrimitiveSource<number>) => HikkakuBlock;
|
|
837
|
+
/**
|
|
838
|
+
* Shows sprite.
|
|
839
|
+
*
|
|
840
|
+
* Input: none.
|
|
841
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
842
|
+
*
|
|
843
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
844
|
+
* @example
|
|
845
|
+
* ```ts
|
|
846
|
+
* import { show } from 'hikkaku/blocks'
|
|
847
|
+
*
|
|
848
|
+
* show()
|
|
849
|
+
* ```
|
|
850
|
+
*/
|
|
65
851
|
declare const show: () => HikkakuBlock;
|
|
852
|
+
/**
|
|
853
|
+
* Hides sprite.
|
|
854
|
+
*
|
|
855
|
+
* Input: none.
|
|
856
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
857
|
+
*
|
|
858
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
859
|
+
* @example
|
|
860
|
+
* ```ts
|
|
861
|
+
* import { hide } from 'hikkaku/blocks'
|
|
862
|
+
*
|
|
863
|
+
* hide()
|
|
864
|
+
* ```
|
|
865
|
+
*/
|
|
66
866
|
declare const hide: () => HikkakuBlock;
|
|
867
|
+
/**
|
|
868
|
+
* Switches costume.
|
|
869
|
+
*
|
|
870
|
+
* Input: `costume`.
|
|
871
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
872
|
+
*
|
|
873
|
+
* @param costume See function signature for accepted input values.
|
|
874
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
875
|
+
* @example
|
|
876
|
+
* ```ts
|
|
877
|
+
* import { switchCostumeTo } from 'hikkaku/blocks'
|
|
878
|
+
*
|
|
879
|
+
* switchCostumeTo('costume1')
|
|
880
|
+
* ```
|
|
881
|
+
*/
|
|
67
882
|
declare const switchCostumeTo: (costume: CostumeSource) => HikkakuBlock;
|
|
883
|
+
/**
|
|
884
|
+
* Next costume.
|
|
885
|
+
*
|
|
886
|
+
* Input: none.
|
|
887
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
888
|
+
*
|
|
889
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
890
|
+
* @example
|
|
891
|
+
* ```ts
|
|
892
|
+
* import { nextCostume } from 'hikkaku/blocks'
|
|
893
|
+
*
|
|
894
|
+
* nextCostume()
|
|
895
|
+
* ```
|
|
896
|
+
*/
|
|
68
897
|
declare const nextCostume: () => HikkakuBlock;
|
|
898
|
+
/**
|
|
899
|
+
* Switch backdrop.
|
|
900
|
+
*
|
|
901
|
+
* Input: `backdrop`.
|
|
902
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
903
|
+
*
|
|
904
|
+
* @param backdrop See function signature for accepted input values.
|
|
905
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
906
|
+
* @example
|
|
907
|
+
* ```ts
|
|
908
|
+
* import { switchBackdropTo } from 'hikkaku/blocks'
|
|
909
|
+
*
|
|
910
|
+
* switchBackdropTo('backdrop1')
|
|
911
|
+
* ```
|
|
912
|
+
*/
|
|
69
913
|
declare const switchBackdropTo: (backdrop: PrimitiveSource<string>) => HikkakuBlock;
|
|
914
|
+
/**
|
|
915
|
+
* Switch backdrop and wait.
|
|
916
|
+
*
|
|
917
|
+
* Input: `backdrop`.
|
|
918
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
919
|
+
*
|
|
920
|
+
* @param backdrop See function signature for accepted input values.
|
|
921
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
922
|
+
* @example
|
|
923
|
+
* ```ts
|
|
924
|
+
* import { switchBackdropToAndWait } from 'hikkaku/blocks'
|
|
925
|
+
*
|
|
926
|
+
* switchBackdropToAndWait('backdrop1')
|
|
927
|
+
* ```
|
|
928
|
+
*/
|
|
70
929
|
declare const switchBackdropToAndWait: (backdrop: PrimitiveSource<string>) => HikkakuBlock;
|
|
930
|
+
/**
|
|
931
|
+
* Next backdrop.
|
|
932
|
+
*
|
|
933
|
+
* Input: none.
|
|
934
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
935
|
+
*
|
|
936
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
937
|
+
* @example
|
|
938
|
+
* ```ts
|
|
939
|
+
* import { nextBackdrop } from 'hikkaku/blocks'
|
|
940
|
+
*
|
|
941
|
+
* nextBackdrop()
|
|
942
|
+
* ```
|
|
943
|
+
*/
|
|
71
944
|
declare const nextBackdrop: () => HikkakuBlock;
|
|
945
|
+
/**
|
|
946
|
+
* Changes graphic effect.
|
|
947
|
+
*
|
|
948
|
+
* Input: `effect`, `value`.
|
|
949
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
950
|
+
*
|
|
951
|
+
* @param effect See function signature for accepted input values.
|
|
952
|
+
* @param value See function signature for accepted input values.
|
|
953
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
954
|
+
* @example
|
|
955
|
+
* ```ts
|
|
956
|
+
* import { changeLooksEffectBy } from 'hikkaku/blocks'
|
|
957
|
+
*
|
|
958
|
+
* changeLooksEffectBy('color', 10)
|
|
959
|
+
* ```
|
|
960
|
+
*/
|
|
72
961
|
declare const changeLooksEffectBy: (effect: LookEffect, value: PrimitiveSource<number>) => HikkakuBlock;
|
|
962
|
+
/**
|
|
963
|
+
* Sets graphic effect.
|
|
964
|
+
*
|
|
965
|
+
* Input: `effect`, `value`.
|
|
966
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
967
|
+
*
|
|
968
|
+
* @param effect See function signature for accepted input values.
|
|
969
|
+
* @param value See function signature for accepted input values.
|
|
970
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
971
|
+
* @example
|
|
972
|
+
* ```ts
|
|
973
|
+
* import { setLooksEffectTo } from 'hikkaku/blocks'
|
|
974
|
+
*
|
|
975
|
+
* setLooksEffectTo('color', 10)
|
|
976
|
+
* ```
|
|
977
|
+
*/
|
|
73
978
|
declare const setLooksEffectTo: (effect: LookEffect, value: PrimitiveSource<number>) => HikkakuBlock;
|
|
979
|
+
/**
|
|
980
|
+
* Clears effects.
|
|
981
|
+
*
|
|
982
|
+
* Input: none.
|
|
983
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
984
|
+
*
|
|
985
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
986
|
+
* @example
|
|
987
|
+
* ```ts
|
|
988
|
+
* import { clearGraphicEffects } from 'hikkaku/blocks'
|
|
989
|
+
*
|
|
990
|
+
* clearGraphicEffects()
|
|
991
|
+
* ```
|
|
992
|
+
*/
|
|
74
993
|
declare const clearGraphicEffects: () => HikkakuBlock;
|
|
994
|
+
/**
|
|
995
|
+
* Changes size.
|
|
996
|
+
*
|
|
997
|
+
* Input: `value`.
|
|
998
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
999
|
+
*
|
|
1000
|
+
* @param value See function signature for accepted input values.
|
|
1001
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1002
|
+
* @example
|
|
1003
|
+
* ```ts
|
|
1004
|
+
* import { changeSizeBy } from 'hikkaku/blocks'
|
|
1005
|
+
*
|
|
1006
|
+
* changeSizeBy(10)
|
|
1007
|
+
* ```
|
|
1008
|
+
*/
|
|
75
1009
|
declare const changeSizeBy: (value: PrimitiveSource<number>) => HikkakuBlock;
|
|
1010
|
+
/**
|
|
1011
|
+
* Sets size.
|
|
1012
|
+
*
|
|
1013
|
+
* Input: `value`.
|
|
1014
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1015
|
+
*
|
|
1016
|
+
* @param value See function signature for accepted input values.
|
|
1017
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1018
|
+
* @example
|
|
1019
|
+
* ```ts
|
|
1020
|
+
* import { setSizeTo } from 'hikkaku/blocks'
|
|
1021
|
+
*
|
|
1022
|
+
* setSizeTo(10)
|
|
1023
|
+
* ```
|
|
1024
|
+
*/
|
|
76
1025
|
declare const setSizeTo: (value: PrimitiveSource<number>) => HikkakuBlock;
|
|
1026
|
+
/**
|
|
1027
|
+
* Moves sprite layer.
|
|
1028
|
+
*
|
|
1029
|
+
* Input: `position`.
|
|
1030
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1031
|
+
*
|
|
1032
|
+
* @param position See function signature for accepted input values.
|
|
1033
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1034
|
+
* @example
|
|
1035
|
+
* ```ts
|
|
1036
|
+
* import { goToFrontBack } from 'hikkaku/blocks'
|
|
1037
|
+
*
|
|
1038
|
+
* goToFrontBack('front')
|
|
1039
|
+
* ```
|
|
1040
|
+
*/
|
|
77
1041
|
declare const goToFrontBack: (position: FrontBack) => HikkakuBlock;
|
|
1042
|
+
/**
|
|
1043
|
+
* Moves layers.
|
|
1044
|
+
*
|
|
1045
|
+
* Input: `direction`, `layers`.
|
|
1046
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1047
|
+
*
|
|
1048
|
+
* @param direction See function signature for accepted input values.
|
|
1049
|
+
* @param layers See function signature for accepted input values.
|
|
1050
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1051
|
+
* @example
|
|
1052
|
+
* ```ts
|
|
1053
|
+
* import { goForwardBackwardLayers } from 'hikkaku/blocks'
|
|
1054
|
+
*
|
|
1055
|
+
* goForwardBackwardLayers('forward', 10)
|
|
1056
|
+
* ```
|
|
1057
|
+
*/
|
|
78
1058
|
declare const goForwardBackwardLayers: (direction: ForwardBackward, layers: PrimitiveSource<number>) => HikkakuBlock;
|
|
1059
|
+
/**
|
|
1060
|
+
* Returns size.
|
|
1061
|
+
*
|
|
1062
|
+
* Input: none.
|
|
1063
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1064
|
+
*
|
|
1065
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1066
|
+
* @example
|
|
1067
|
+
* ```ts
|
|
1068
|
+
* import { getSize } from 'hikkaku/blocks'
|
|
1069
|
+
*
|
|
1070
|
+
* getSize()
|
|
1071
|
+
* ```
|
|
1072
|
+
*/
|
|
79
1073
|
declare const getSize: () => HikkakuBlock;
|
|
1074
|
+
/**
|
|
1075
|
+
* Returns costume number or name.
|
|
1076
|
+
*
|
|
1077
|
+
* Input: `value`.
|
|
1078
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1079
|
+
*
|
|
1080
|
+
* @param value See function signature for accepted input values.
|
|
1081
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1082
|
+
* @example
|
|
1083
|
+
* ```ts
|
|
1084
|
+
* import { getCostumeNumberName } from 'hikkaku/blocks'
|
|
1085
|
+
*
|
|
1086
|
+
* getCostumeNumberName(10)
|
|
1087
|
+
* ```
|
|
1088
|
+
*/
|
|
80
1089
|
declare const getCostumeNumberName: (value: NumberName) => HikkakuBlock;
|
|
1090
|
+
/**
|
|
1091
|
+
* Returns backdrop number or name.
|
|
1092
|
+
*
|
|
1093
|
+
* Input: `value`.
|
|
1094
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1095
|
+
*
|
|
1096
|
+
* @param value See function signature for accepted input values.
|
|
1097
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1098
|
+
* @example
|
|
1099
|
+
* ```ts
|
|
1100
|
+
* import { getBackdropNumberName } from 'hikkaku/blocks'
|
|
1101
|
+
*
|
|
1102
|
+
* getBackdropNumberName(10)
|
|
1103
|
+
* ```
|
|
1104
|
+
*/
|
|
81
1105
|
declare const getBackdropNumberName: (value: NumberName) => HikkakuBlock;
|
|
82
1106
|
//#endregion
|
|
83
1107
|
//#region src/blocks/motion.d.ts
|
|
1108
|
+
/**
|
|
1109
|
+
* Moves sprite.
|
|
1110
|
+
*
|
|
1111
|
+
* Input: `steps`.
|
|
1112
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1113
|
+
*
|
|
1114
|
+
* @param steps See function signature for accepted input values.
|
|
1115
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1116
|
+
* @example
|
|
1117
|
+
* ```ts
|
|
1118
|
+
* import { moveSteps } from 'hikkaku/blocks'
|
|
1119
|
+
*
|
|
1120
|
+
* moveSteps(undefined as any)
|
|
1121
|
+
* ```
|
|
1122
|
+
*/
|
|
84
1123
|
declare const moveSteps: (steps: PrimitiveSource<number>) => HikkakuBlock;
|
|
1124
|
+
/**
|
|
1125
|
+
* Moves to coordinates.
|
|
1126
|
+
*
|
|
1127
|
+
* Input: `x`, `y`.
|
|
1128
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1129
|
+
*
|
|
1130
|
+
* @param x See function signature for accepted input values.
|
|
1131
|
+
* @param y See function signature for accepted input values.
|
|
1132
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1133
|
+
* @example
|
|
1134
|
+
* ```ts
|
|
1135
|
+
* import { gotoXY } from 'hikkaku/blocks'
|
|
1136
|
+
*
|
|
1137
|
+
* gotoXY(10, 10)
|
|
1138
|
+
* ```
|
|
1139
|
+
*/
|
|
85
1140
|
declare const gotoXY: (x: PrimitiveSource<number>, y: PrimitiveSource<number>) => HikkakuBlock;
|
|
1141
|
+
/**
|
|
1142
|
+
* Changes X.
|
|
1143
|
+
*
|
|
1144
|
+
* Input: `dx`.
|
|
1145
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1146
|
+
*
|
|
1147
|
+
* @param dx See function signature for accepted input values.
|
|
1148
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1149
|
+
* @example
|
|
1150
|
+
* ```ts
|
|
1151
|
+
* import { changeXBy } from 'hikkaku/blocks'
|
|
1152
|
+
*
|
|
1153
|
+
* changeXBy(10)
|
|
1154
|
+
* ```
|
|
1155
|
+
*/
|
|
86
1156
|
declare const changeXBy: (dx: PrimitiveSource<number>) => HikkakuBlock;
|
|
1157
|
+
/**
|
|
1158
|
+
* Changes Y.
|
|
1159
|
+
*
|
|
1160
|
+
* Input: `dy`.
|
|
1161
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1162
|
+
*
|
|
1163
|
+
* @param dy See function signature for accepted input values.
|
|
1164
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1165
|
+
* @example
|
|
1166
|
+
* ```ts
|
|
1167
|
+
* import { changeYBy } from 'hikkaku/blocks'
|
|
1168
|
+
*
|
|
1169
|
+
* changeYBy(10)
|
|
1170
|
+
* ```
|
|
1171
|
+
*/
|
|
87
1172
|
declare const changeYBy: (dy: PrimitiveSource<number>) => HikkakuBlock;
|
|
1173
|
+
/**
|
|
1174
|
+
* Sets X.
|
|
1175
|
+
*
|
|
1176
|
+
* Input: `x`.
|
|
1177
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1178
|
+
*
|
|
1179
|
+
* @param x See function signature for accepted input values.
|
|
1180
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1181
|
+
* @example
|
|
1182
|
+
* ```ts
|
|
1183
|
+
* import { setX } from 'hikkaku/blocks'
|
|
1184
|
+
*
|
|
1185
|
+
* setX(10)
|
|
1186
|
+
* ```
|
|
1187
|
+
*/
|
|
88
1188
|
declare const setX: (x: PrimitiveSource<number>) => HikkakuBlock;
|
|
1189
|
+
/**
|
|
1190
|
+
* Sets Y.
|
|
1191
|
+
*
|
|
1192
|
+
* Input: `y`.
|
|
1193
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1194
|
+
*
|
|
1195
|
+
* @param y See function signature for accepted input values.
|
|
1196
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1197
|
+
* @example
|
|
1198
|
+
* ```ts
|
|
1199
|
+
* import { setY } from 'hikkaku/blocks'
|
|
1200
|
+
*
|
|
1201
|
+
* setY(10)
|
|
1202
|
+
* ```
|
|
1203
|
+
*/
|
|
89
1204
|
declare const setY: (y: PrimitiveSource<number>) => HikkakuBlock;
|
|
1205
|
+
/**
|
|
1206
|
+
* Moves to target.
|
|
1207
|
+
*
|
|
1208
|
+
* Input: `target`.
|
|
1209
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1210
|
+
*
|
|
1211
|
+
* @param target See function signature for accepted input values.
|
|
1212
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1213
|
+
* @example
|
|
1214
|
+
* ```ts
|
|
1215
|
+
* import { goTo } from 'hikkaku/blocks'
|
|
1216
|
+
*
|
|
1217
|
+
* goTo('mouse-pointer')
|
|
1218
|
+
* ```
|
|
1219
|
+
*/
|
|
90
1220
|
declare const goTo: (target: string) => HikkakuBlock;
|
|
1221
|
+
/**
|
|
1222
|
+
* Turns right.
|
|
1223
|
+
*
|
|
1224
|
+
* Input: `degrees`.
|
|
1225
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1226
|
+
*
|
|
1227
|
+
* @param degrees See function signature for accepted input values.
|
|
1228
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1229
|
+
* @example
|
|
1230
|
+
* ```ts
|
|
1231
|
+
* import { turnRight } from 'hikkaku/blocks'
|
|
1232
|
+
*
|
|
1233
|
+
* turnRight(10)
|
|
1234
|
+
* ```
|
|
1235
|
+
*/
|
|
91
1236
|
declare const turnRight: (degrees: PrimitiveSource<number>) => HikkakuBlock;
|
|
1237
|
+
/**
|
|
1238
|
+
* Turns left.
|
|
1239
|
+
*
|
|
1240
|
+
* Input: `degrees`.
|
|
1241
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1242
|
+
*
|
|
1243
|
+
* @param degrees See function signature for accepted input values.
|
|
1244
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1245
|
+
* @example
|
|
1246
|
+
* ```ts
|
|
1247
|
+
* import { turnLeft } from 'hikkaku/blocks'
|
|
1248
|
+
*
|
|
1249
|
+
* turnLeft(10)
|
|
1250
|
+
* ```
|
|
1251
|
+
*/
|
|
92
1252
|
declare const turnLeft: (degrees: PrimitiveSource<number>) => HikkakuBlock;
|
|
1253
|
+
/**
|
|
1254
|
+
* Points direction.
|
|
1255
|
+
*
|
|
1256
|
+
* Input: `direction`.
|
|
1257
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1258
|
+
*
|
|
1259
|
+
* @param direction See function signature for accepted input values.
|
|
1260
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1261
|
+
* @example
|
|
1262
|
+
* ```ts
|
|
1263
|
+
* import { pointInDirection } from 'hikkaku/blocks'
|
|
1264
|
+
*
|
|
1265
|
+
* pointInDirection('forward')
|
|
1266
|
+
* ```
|
|
1267
|
+
*/
|
|
93
1268
|
declare const pointInDirection: (direction: PrimitiveSource<number>) => HikkakuBlock;
|
|
1269
|
+
/**
|
|
1270
|
+
* Points toward target.
|
|
1271
|
+
*
|
|
1272
|
+
* Input: `target`.
|
|
1273
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1274
|
+
*
|
|
1275
|
+
* @param target See function signature for accepted input values.
|
|
1276
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1277
|
+
* @example
|
|
1278
|
+
* ```ts
|
|
1279
|
+
* import { pointTowards } from 'hikkaku/blocks'
|
|
1280
|
+
*
|
|
1281
|
+
* pointTowards('mouse-pointer')
|
|
1282
|
+
* ```
|
|
1283
|
+
*/
|
|
94
1284
|
declare const pointTowards: (target: string) => HikkakuBlock;
|
|
1285
|
+
/**
|
|
1286
|
+
* Glides to position.
|
|
1287
|
+
*
|
|
1288
|
+
* Input: `seconds`, `x`, `y`.
|
|
1289
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1290
|
+
*
|
|
1291
|
+
* @param seconds See function signature for accepted input values.
|
|
1292
|
+
* @param x See function signature for accepted input values.
|
|
1293
|
+
* @param y See function signature for accepted input values.
|
|
1294
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1295
|
+
* @example
|
|
1296
|
+
* ```ts
|
|
1297
|
+
* import { glide } from 'hikkaku/blocks'
|
|
1298
|
+
*
|
|
1299
|
+
* glide(10, 10, 10)
|
|
1300
|
+
* ```
|
|
1301
|
+
*/
|
|
95
1302
|
declare const glide: (seconds: PrimitiveSource<number>, x: PrimitiveSource<number>, y: PrimitiveSource<number>) => HikkakuBlock;
|
|
1303
|
+
/**
|
|
1304
|
+
* Glides to target.
|
|
1305
|
+
*
|
|
1306
|
+
* Input: `seconds`, `target`.
|
|
1307
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1308
|
+
*
|
|
1309
|
+
* @param seconds See function signature for accepted input values.
|
|
1310
|
+
* @param target See function signature for accepted input values.
|
|
1311
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1312
|
+
* @example
|
|
1313
|
+
* ```ts
|
|
1314
|
+
* import { glideTo } from 'hikkaku/blocks'
|
|
1315
|
+
*
|
|
1316
|
+
* glideTo(10, 'mouse-pointer')
|
|
1317
|
+
* ```
|
|
1318
|
+
*/
|
|
96
1319
|
declare const glideTo: (seconds: PrimitiveSource<number>, target: string) => HikkakuBlock;
|
|
1320
|
+
/**
|
|
1321
|
+
* Bounces on edge.
|
|
1322
|
+
*
|
|
1323
|
+
* Input: none.
|
|
1324
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1325
|
+
*
|
|
1326
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1327
|
+
* @example
|
|
1328
|
+
* ```ts
|
|
1329
|
+
* import { ifOnEdgeBounce } from 'hikkaku/blocks'
|
|
1330
|
+
*
|
|
1331
|
+
* ifOnEdgeBounce()
|
|
1332
|
+
* ```
|
|
1333
|
+
*/
|
|
97
1334
|
declare const ifOnEdgeBounce: () => HikkakuBlock;
|
|
1335
|
+
/**
|
|
1336
|
+
* Sets rotation style.
|
|
1337
|
+
*
|
|
1338
|
+
* Input: `style`.
|
|
1339
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1340
|
+
*
|
|
1341
|
+
* @param style See function signature for accepted input values.
|
|
1342
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1343
|
+
* @example
|
|
1344
|
+
* ```ts
|
|
1345
|
+
* import { setRotationStyle } from 'hikkaku/blocks'
|
|
1346
|
+
*
|
|
1347
|
+
* setRotationStyle('all around')
|
|
1348
|
+
* ```
|
|
1349
|
+
*/
|
|
98
1350
|
declare const setRotationStyle: (style: "all around" | "left-right" | "don't rotate") => HikkakuBlock;
|
|
1351
|
+
/**
|
|
1352
|
+
* Returns X position.
|
|
1353
|
+
*
|
|
1354
|
+
* Input: none.
|
|
1355
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1356
|
+
*
|
|
1357
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1358
|
+
* @example
|
|
1359
|
+
* ```ts
|
|
1360
|
+
* import { getX } from 'hikkaku/blocks'
|
|
1361
|
+
*
|
|
1362
|
+
* getX()
|
|
1363
|
+
* ```
|
|
1364
|
+
*/
|
|
99
1365
|
declare const getX: () => HikkakuBlock;
|
|
1366
|
+
/**
|
|
1367
|
+
* Returns Y position.
|
|
1368
|
+
*
|
|
1369
|
+
* Input: none.
|
|
1370
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1371
|
+
*
|
|
1372
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1373
|
+
* @example
|
|
1374
|
+
* ```ts
|
|
1375
|
+
* import { getY } from 'hikkaku/blocks'
|
|
1376
|
+
*
|
|
1377
|
+
* getY()
|
|
1378
|
+
* ```
|
|
1379
|
+
*/
|
|
100
1380
|
declare const getY: () => HikkakuBlock;
|
|
1381
|
+
/**
|
|
1382
|
+
* Returns direction.
|
|
1383
|
+
*
|
|
1384
|
+
* Input: none.
|
|
1385
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1386
|
+
*
|
|
1387
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1388
|
+
* @example
|
|
1389
|
+
* ```ts
|
|
1390
|
+
* import { getDirection } from 'hikkaku/blocks'
|
|
1391
|
+
*
|
|
1392
|
+
* getDirection()
|
|
1393
|
+
* ```
|
|
1394
|
+
*/
|
|
101
1395
|
declare const getDirection: () => HikkakuBlock;
|
|
102
1396
|
//#endregion
|
|
103
1397
|
//#region src/blocks/operator.d.ts
|
|
1398
|
+
/**
|
|
1399
|
+
* Addition.
|
|
1400
|
+
*
|
|
1401
|
+
* Input: `a`, `b`.
|
|
1402
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1403
|
+
*
|
|
1404
|
+
* @param a See function signature for accepted input values.
|
|
1405
|
+
* @param b See function signature for accepted input values.
|
|
1406
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1407
|
+
* @example
|
|
1408
|
+
* ```ts
|
|
1409
|
+
* import { add } from 'hikkaku/blocks'
|
|
1410
|
+
*
|
|
1411
|
+
* add(1, 2)
|
|
1412
|
+
* ```
|
|
1413
|
+
*/
|
|
104
1414
|
declare const add: (a: PrimitiveSource<number>, b: PrimitiveSource<number>) => HikkakuBlock;
|
|
1415
|
+
/**
|
|
1416
|
+
* Subtraction.
|
|
1417
|
+
*
|
|
1418
|
+
* Input: `a`, `b`.
|
|
1419
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1420
|
+
*
|
|
1421
|
+
* @param a See function signature for accepted input values.
|
|
1422
|
+
* @param b See function signature for accepted input values.
|
|
1423
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1424
|
+
* @example
|
|
1425
|
+
* ```ts
|
|
1426
|
+
* import { subtract } from 'hikkaku/blocks'
|
|
1427
|
+
*
|
|
1428
|
+
* subtract(5, 3)
|
|
1429
|
+
* ```
|
|
1430
|
+
*/
|
|
105
1431
|
declare const subtract: (a: PrimitiveSource<number>, b: PrimitiveSource<number>) => HikkakuBlock;
|
|
1432
|
+
/**
|
|
1433
|
+
* Multiplication.
|
|
1434
|
+
*
|
|
1435
|
+
* Input: `a`, `b`.
|
|
1436
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1437
|
+
*
|
|
1438
|
+
* @param a See function signature for accepted input values.
|
|
1439
|
+
* @param b See function signature for accepted input values.
|
|
1440
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1441
|
+
* @example
|
|
1442
|
+
* ```ts
|
|
1443
|
+
* import { multiply } from 'hikkaku/blocks'
|
|
1444
|
+
*
|
|
1445
|
+
* multiply(3, 4)
|
|
1446
|
+
* ```
|
|
1447
|
+
*/
|
|
106
1448
|
declare const multiply: (a: PrimitiveSource<number>, b: PrimitiveSource<number>) => HikkakuBlock;
|
|
1449
|
+
/**
|
|
1450
|
+
* Division.
|
|
1451
|
+
*
|
|
1452
|
+
* Input: `a`, `b`.
|
|
1453
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1454
|
+
*
|
|
1455
|
+
* @param a See function signature for accepted input values.
|
|
1456
|
+
* @param b See function signature for accepted input values.
|
|
1457
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1458
|
+
* @example
|
|
1459
|
+
* ```ts
|
|
1460
|
+
* import { divide } from 'hikkaku/blocks'
|
|
1461
|
+
*
|
|
1462
|
+
* divide(10, 2)
|
|
1463
|
+
* ```
|
|
1464
|
+
*/
|
|
107
1465
|
declare const divide: (a: PrimitiveSource<number>, b: PrimitiveSource<number>) => HikkakuBlock;
|
|
1466
|
+
/**
|
|
1467
|
+
* Less-than comparison.
|
|
1468
|
+
*
|
|
1469
|
+
* Input: `a`, `b`.
|
|
1470
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1471
|
+
*
|
|
1472
|
+
* @param a See function signature for accepted input values.
|
|
1473
|
+
* @param b See function signature for accepted input values.
|
|
1474
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1475
|
+
* @example
|
|
1476
|
+
* ```ts
|
|
1477
|
+
* import { lt } from 'hikkaku/blocks'
|
|
1478
|
+
*
|
|
1479
|
+
* lt(1, 2)
|
|
1480
|
+
* ```
|
|
1481
|
+
*/
|
|
108
1482
|
declare const lt: (a: PrimitiveSource<number | string>, b: PrimitiveSource<number | string>) => HikkakuBlock;
|
|
1483
|
+
/**
|
|
1484
|
+
* Equality comparison.
|
|
1485
|
+
*
|
|
1486
|
+
* Input: `a`, `b`.
|
|
1487
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1488
|
+
*
|
|
1489
|
+
* @param a See function signature for accepted input values.
|
|
1490
|
+
* @param b See function signature for accepted input values.
|
|
1491
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1492
|
+
* @example
|
|
1493
|
+
* ```ts
|
|
1494
|
+
* import { equals } from 'hikkaku/blocks'
|
|
1495
|
+
*
|
|
1496
|
+
* equals(5, 5)
|
|
1497
|
+
* ```
|
|
1498
|
+
*/
|
|
109
1499
|
declare const equals: (a: PrimitiveSource<number | string>, b: PrimitiveSource<number | string>) => HikkakuBlock;
|
|
1500
|
+
/**
|
|
1501
|
+
* Greater-than comparison.
|
|
1502
|
+
*
|
|
1503
|
+
* Input: `a`, `b`.
|
|
1504
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1505
|
+
*
|
|
1506
|
+
* @param a See function signature for accepted input values.
|
|
1507
|
+
* @param b See function signature for accepted input values.
|
|
1508
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1509
|
+
* @example
|
|
1510
|
+
* ```ts
|
|
1511
|
+
* import { gt } from 'hikkaku/blocks'
|
|
1512
|
+
*
|
|
1513
|
+
* gt(10, 5)
|
|
1514
|
+
* ```
|
|
1515
|
+
*/
|
|
110
1516
|
declare const gt: (a: PrimitiveSource<number | string>, b: PrimitiveSource<number | string>) => HikkakuBlock;
|
|
1517
|
+
/**
|
|
1518
|
+
* Logical AND.
|
|
1519
|
+
*
|
|
1520
|
+
* Input: `a`, `b`.
|
|
1521
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1522
|
+
*
|
|
1523
|
+
* @param a See function signature for accepted input values.
|
|
1524
|
+
* @param b See function signature for accepted input values.
|
|
1525
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1526
|
+
* @example
|
|
1527
|
+
* ```ts
|
|
1528
|
+
* import { and } from 'hikkaku/blocks'
|
|
1529
|
+
*
|
|
1530
|
+
* and(true, false)
|
|
1531
|
+
* ```
|
|
1532
|
+
*/
|
|
111
1533
|
declare const and: (a: PrimitiveSource<boolean>, b: PrimitiveSource<boolean>) => HikkakuBlock;
|
|
1534
|
+
/**
|
|
1535
|
+
* Logical OR.
|
|
1536
|
+
*
|
|
1537
|
+
* Input: `a`, `b`.
|
|
1538
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1539
|
+
*
|
|
1540
|
+
* @param a See function signature for accepted input values.
|
|
1541
|
+
* @param b See function signature for accepted input values.
|
|
1542
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1543
|
+
* @example
|
|
1544
|
+
* ```ts
|
|
1545
|
+
* import { or } from 'hikkaku/blocks'
|
|
1546
|
+
*
|
|
1547
|
+
* or(true, false)
|
|
1548
|
+
* ```
|
|
1549
|
+
*/
|
|
112
1550
|
declare const or: (a: PrimitiveSource<boolean>, b: PrimitiveSource<boolean>) => HikkakuBlock;
|
|
1551
|
+
/**
|
|
1552
|
+
* Logical NOT.
|
|
1553
|
+
*
|
|
1554
|
+
* Input: `operand`.
|
|
1555
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1556
|
+
*
|
|
1557
|
+
* @param operand See function signature for accepted input values.
|
|
1558
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1559
|
+
* @example
|
|
1560
|
+
* ```ts
|
|
1561
|
+
* import { not } from 'hikkaku/blocks'
|
|
1562
|
+
*
|
|
1563
|
+
* not(false)
|
|
1564
|
+
* ```
|
|
1565
|
+
*/
|
|
113
1566
|
declare const not: (operand: PrimitiveSource<boolean>) => HikkakuBlock;
|
|
1567
|
+
/**
|
|
1568
|
+
* Random number.
|
|
1569
|
+
*
|
|
1570
|
+
* Input: `from`, `to`.
|
|
1571
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1572
|
+
*
|
|
1573
|
+
* @param from See function signature for accepted input values.
|
|
1574
|
+
* @param to See function signature for accepted input values.
|
|
1575
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1576
|
+
* @example
|
|
1577
|
+
* ```ts
|
|
1578
|
+
* import { random } from 'hikkaku/blocks'
|
|
1579
|
+
*
|
|
1580
|
+
* random(10, 10)
|
|
1581
|
+
* ```
|
|
1582
|
+
*/
|
|
114
1583
|
declare const random: (from: PrimitiveSource<number>, to: PrimitiveSource<number>) => HikkakuBlock;
|
|
1584
|
+
/**
|
|
1585
|
+
* String concatenation.
|
|
1586
|
+
*
|
|
1587
|
+
* Input: `a`, `b`.
|
|
1588
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1589
|
+
*
|
|
1590
|
+
* @param a See function signature for accepted input values.
|
|
1591
|
+
* @param b See function signature for accepted input values.
|
|
1592
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1593
|
+
* @example
|
|
1594
|
+
* ```ts
|
|
1595
|
+
* import { join } from 'hikkaku/blocks'
|
|
1596
|
+
*
|
|
1597
|
+
* join('Hello', 'World')
|
|
1598
|
+
* ```
|
|
1599
|
+
*/
|
|
115
1600
|
declare const join: (a: PrimitiveSource<string>, b: PrimitiveSource<string>) => HikkakuBlock;
|
|
1601
|
+
/**
|
|
1602
|
+
* Character extraction.
|
|
1603
|
+
*
|
|
1604
|
+
* Input: `letter`, `text`.
|
|
1605
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1606
|
+
*
|
|
1607
|
+
* @param letter See function signature for accepted input values.
|
|
1608
|
+
* @param text See function signature for accepted input values.
|
|
1609
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1610
|
+
* @example
|
|
1611
|
+
* ```ts
|
|
1612
|
+
* import { letterOf } from 'hikkaku/blocks'
|
|
1613
|
+
*
|
|
1614
|
+
* letterOf(10, 'Hello')
|
|
1615
|
+
* ```
|
|
1616
|
+
*/
|
|
116
1617
|
declare const letterOf: (letter: PrimitiveSource<number>, text: PrimitiveSource<string>) => HikkakuBlock;
|
|
1618
|
+
/**
|
|
1619
|
+
* String length.
|
|
1620
|
+
*
|
|
1621
|
+
* Input: `text`.
|
|
1622
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1623
|
+
*
|
|
1624
|
+
* @param text See function signature for accepted input values.
|
|
1625
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1626
|
+
* @example
|
|
1627
|
+
* ```ts
|
|
1628
|
+
* import { length } from 'hikkaku/blocks'
|
|
1629
|
+
*
|
|
1630
|
+
* length('Hello')
|
|
1631
|
+
* ```
|
|
1632
|
+
*/
|
|
117
1633
|
declare const length: (text: PrimitiveSource<string>) => HikkakuBlock;
|
|
1634
|
+
/**
|
|
1635
|
+
* Substring check.
|
|
1636
|
+
*
|
|
1637
|
+
* Input: `text`, `substring`.
|
|
1638
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1639
|
+
*
|
|
1640
|
+
* @param text See function signature for accepted input values.
|
|
1641
|
+
* @param substring See function signature for accepted input values.
|
|
1642
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1643
|
+
* @example
|
|
1644
|
+
* ```ts
|
|
1645
|
+
* import { contains } from 'hikkaku/blocks'
|
|
1646
|
+
*
|
|
1647
|
+
* contains('Hello', 'Hello')
|
|
1648
|
+
* ```
|
|
1649
|
+
*/
|
|
118
1650
|
declare const contains: (text: PrimitiveSource<string>, substring: PrimitiveSource<string>) => HikkakuBlock;
|
|
1651
|
+
/**
|
|
1652
|
+
* Modulo.
|
|
1653
|
+
*
|
|
1654
|
+
* Input: `a`, `b`.
|
|
1655
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1656
|
+
*
|
|
1657
|
+
* @param a See function signature for accepted input values.
|
|
1658
|
+
* @param b See function signature for accepted input values.
|
|
1659
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1660
|
+
* @example
|
|
1661
|
+
* ```ts
|
|
1662
|
+
* import { mod } from 'hikkaku/blocks'
|
|
1663
|
+
*
|
|
1664
|
+
* mod(10, 3)
|
|
1665
|
+
* ```
|
|
1666
|
+
*/
|
|
119
1667
|
declare const mod: (a: PrimitiveSource<number>, b: PrimitiveSource<number>) => HikkakuBlock;
|
|
1668
|
+
/**
|
|
1669
|
+
* Rounds number.
|
|
1670
|
+
*
|
|
1671
|
+
* Input: `value`.
|
|
1672
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1673
|
+
*
|
|
1674
|
+
* @param value See function signature for accepted input values.
|
|
1675
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1676
|
+
* @example
|
|
1677
|
+
* ```ts
|
|
1678
|
+
* import { round } from 'hikkaku/blocks'
|
|
1679
|
+
*
|
|
1680
|
+
* round(10)
|
|
1681
|
+
* ```
|
|
1682
|
+
*/
|
|
120
1683
|
declare const round: (value: PrimitiveSource<number>) => HikkakuBlock;
|
|
121
1684
|
type MathOpOperator = 'abs' | 'floor' | 'ceiling' | 'sqrt' | 'sin' | 'cos' | 'tan' | 'asin' | 'acos' | 'atan' | 'ln' | 'log' | 'e ^' | '10 ^';
|
|
1685
|
+
/**
|
|
1686
|
+
* Math operation (sin, cos, log, etc.).
|
|
1687
|
+
*
|
|
1688
|
+
* Input: `operator`, `value`.
|
|
1689
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1690
|
+
*
|
|
1691
|
+
* @param operator See function signature for accepted input values.
|
|
1692
|
+
* @param value See function signature for accepted input values.
|
|
1693
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
1694
|
+
* @example
|
|
1695
|
+
* ```ts
|
|
1696
|
+
* import { mathop } from 'hikkaku/blocks'
|
|
1697
|
+
*
|
|
1698
|
+
* mathop('abs', 10)
|
|
1699
|
+
* ```
|
|
1700
|
+
*/
|
|
122
1701
|
declare const mathop: (operator: MathOpOperator, value: PrimitiveSource<number>) => HikkakuBlock;
|
|
123
1702
|
//#endregion
|
|
124
1703
|
//#region src/blocks/pen.d.ts
|
|
125
1704
|
type PenColorParam = 'color' | 'saturation' | 'brightness' | 'transparency';
|
|
1705
|
+
/**
|
|
1706
|
+
* Clears all pen marks.
|
|
1707
|
+
*
|
|
1708
|
+
* Input: none.
|
|
1709
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1710
|
+
*
|
|
1711
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1712
|
+
* @example
|
|
1713
|
+
* ```ts
|
|
1714
|
+
* import { eraseAll } from 'hikkaku/blocks'
|
|
1715
|
+
*
|
|
1716
|
+
* eraseAll()
|
|
1717
|
+
* ```
|
|
1718
|
+
*/
|
|
126
1719
|
declare const eraseAll: () => HikkakuBlock;
|
|
1720
|
+
/**
|
|
1721
|
+
* Alias for {@link eraseAll}.
|
|
1722
|
+
*
|
|
1723
|
+
* Input: none.
|
|
1724
|
+
* Output: Same Scratch statement block definition as {@link eraseAll}.
|
|
1725
|
+
*
|
|
1726
|
+
* @example
|
|
1727
|
+
* ```ts
|
|
1728
|
+
* import { clear } from 'hikkaku/blocks'
|
|
1729
|
+
*
|
|
1730
|
+
* clear()
|
|
1731
|
+
* ```
|
|
1732
|
+
*/
|
|
127
1733
|
declare const clear: () => HikkakuBlock;
|
|
1734
|
+
/**
|
|
1735
|
+
* Stamps sprite costume.
|
|
1736
|
+
*
|
|
1737
|
+
* Input: none.
|
|
1738
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1739
|
+
*
|
|
1740
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1741
|
+
* @example
|
|
1742
|
+
* ```ts
|
|
1743
|
+
* import { stamp } from 'hikkaku/blocks'
|
|
1744
|
+
*
|
|
1745
|
+
* stamp()
|
|
1746
|
+
* ```
|
|
1747
|
+
*/
|
|
128
1748
|
declare const stamp: () => HikkakuBlock;
|
|
1749
|
+
/**
|
|
1750
|
+
* Starts drawing.
|
|
1751
|
+
*
|
|
1752
|
+
* Input: none.
|
|
1753
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1754
|
+
*
|
|
1755
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1756
|
+
* @example
|
|
1757
|
+
* ```ts
|
|
1758
|
+
* import { penDown } from 'hikkaku/blocks'
|
|
1759
|
+
*
|
|
1760
|
+
* penDown()
|
|
1761
|
+
* ```
|
|
1762
|
+
*/
|
|
129
1763
|
declare const penDown: () => HikkakuBlock;
|
|
1764
|
+
/**
|
|
1765
|
+
* Stops drawing.
|
|
1766
|
+
*
|
|
1767
|
+
* Input: none.
|
|
1768
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1769
|
+
*
|
|
1770
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1771
|
+
* @example
|
|
1772
|
+
* ```ts
|
|
1773
|
+
* import { penUp } from 'hikkaku/blocks'
|
|
1774
|
+
*
|
|
1775
|
+
* penUp()
|
|
1776
|
+
* ```
|
|
1777
|
+
*/
|
|
130
1778
|
declare const penUp: () => HikkakuBlock;
|
|
1779
|
+
/**
|
|
1780
|
+
* Sets pen color.
|
|
1781
|
+
*
|
|
1782
|
+
* Input: `color`.
|
|
1783
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1784
|
+
*
|
|
1785
|
+
* @param color See function signature for accepted input values.
|
|
1786
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1787
|
+
* @example
|
|
1788
|
+
* ```ts
|
|
1789
|
+
* import { setPenColorTo } from 'hikkaku/blocks'
|
|
1790
|
+
*
|
|
1791
|
+
* setPenColorTo(undefined as any)
|
|
1792
|
+
* ```
|
|
1793
|
+
*/
|
|
131
1794
|
declare const setPenColorTo: (color: PrimitiveSource<string>) => HikkakuBlock;
|
|
1795
|
+
/**
|
|
1796
|
+
* Alias for {@link setPenColorTo}.
|
|
1797
|
+
*
|
|
1798
|
+
* Input: `color`.
|
|
1799
|
+
* Output: Same Scratch statement block definition as {@link setPenColorTo}.
|
|
1800
|
+
*
|
|
1801
|
+
* @param color See function signature for accepted input values.
|
|
1802
|
+
* @example
|
|
1803
|
+
* ```ts
|
|
1804
|
+
* import { setPenColorToColor } from 'hikkaku/blocks'
|
|
1805
|
+
*
|
|
1806
|
+
* setPenColorToColor('#ff0000')
|
|
1807
|
+
* ```
|
|
1808
|
+
*/
|
|
132
1809
|
declare const setPenColorToColor: (color: PrimitiveSource<string>) => HikkakuBlock;
|
|
1810
|
+
/**
|
|
1811
|
+
* Changes pen color parameter by amount.
|
|
1812
|
+
*
|
|
1813
|
+
* Input: `param`, `value`.
|
|
1814
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1815
|
+
*
|
|
1816
|
+
* @param param See function signature for accepted input values.
|
|
1817
|
+
* @param value See function signature for accepted input values.
|
|
1818
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1819
|
+
* @example
|
|
1820
|
+
* ```ts
|
|
1821
|
+
* import { changePenColorParamBy } from 'hikkaku/blocks'
|
|
1822
|
+
*
|
|
1823
|
+
* changePenColorParamBy(undefined as any, 10)
|
|
1824
|
+
* ```
|
|
1825
|
+
*/
|
|
133
1826
|
declare const changePenColorParamBy: (param: PrimitiveSource<PenColorParam>, value: PrimitiveSource<number>) => HikkakuBlock;
|
|
1827
|
+
/**
|
|
1828
|
+
* Sets pen color parameter to value.
|
|
1829
|
+
*
|
|
1830
|
+
* Input: `param`, `value`.
|
|
1831
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1832
|
+
*
|
|
1833
|
+
* @param param See function signature for accepted input values.
|
|
1834
|
+
* @param value See function signature for accepted input values.
|
|
1835
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1836
|
+
* @example
|
|
1837
|
+
* ```ts
|
|
1838
|
+
* import { setPenColorParamTo } from 'hikkaku/blocks'
|
|
1839
|
+
*
|
|
1840
|
+
* setPenColorParamTo(undefined as any, 10)
|
|
1841
|
+
* ```
|
|
1842
|
+
*/
|
|
134
1843
|
declare const setPenColorParamTo: (param: PrimitiveSource<PenColorParam>, value: PrimitiveSource<number>) => HikkakuBlock;
|
|
1844
|
+
/**
|
|
1845
|
+
* Changes pen size by amount.
|
|
1846
|
+
*
|
|
1847
|
+
* Input: `size`.
|
|
1848
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1849
|
+
*
|
|
1850
|
+
* @param size See function signature for accepted input values.
|
|
1851
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1852
|
+
* @example
|
|
1853
|
+
* ```ts
|
|
1854
|
+
* import { changePenSizeBy } from 'hikkaku/blocks'
|
|
1855
|
+
*
|
|
1856
|
+
* changePenSizeBy(10)
|
|
1857
|
+
* ```
|
|
1858
|
+
*/
|
|
135
1859
|
declare const changePenSizeBy: (size: PrimitiveSource<number>) => HikkakuBlock;
|
|
1860
|
+
/**
|
|
1861
|
+
* Sets pen size to value.
|
|
1862
|
+
*
|
|
1863
|
+
* Input: `size`.
|
|
1864
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1865
|
+
*
|
|
1866
|
+
* @param size See function signature for accepted input values.
|
|
1867
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1868
|
+
* @example
|
|
1869
|
+
* ```ts
|
|
1870
|
+
* import { setPenSizeTo } from 'hikkaku/blocks'
|
|
1871
|
+
*
|
|
1872
|
+
* setPenSizeTo(10)
|
|
1873
|
+
* ```
|
|
1874
|
+
*/
|
|
136
1875
|
declare const setPenSizeTo: (size: PrimitiveSource<number>) => HikkakuBlock;
|
|
1876
|
+
/**
|
|
1877
|
+
* Sets pen shade to value.
|
|
1878
|
+
*
|
|
1879
|
+
* Input: `shade`.
|
|
1880
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1881
|
+
*
|
|
1882
|
+
* @param shade See function signature for accepted input values.
|
|
1883
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1884
|
+
* @example
|
|
1885
|
+
* ```ts
|
|
1886
|
+
* import { setPenShadeToNumber } from 'hikkaku/blocks'
|
|
1887
|
+
*
|
|
1888
|
+
* setPenShadeToNumber(10)
|
|
1889
|
+
* ```
|
|
1890
|
+
*/
|
|
137
1891
|
declare const setPenShadeToNumber: (shade: PrimitiveSource<number>) => HikkakuBlock;
|
|
1892
|
+
/**
|
|
1893
|
+
* Changes pen shade by amount.
|
|
1894
|
+
*
|
|
1895
|
+
* Input: `shade`.
|
|
1896
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1897
|
+
*
|
|
1898
|
+
* @param shade See function signature for accepted input values.
|
|
1899
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1900
|
+
* @example
|
|
1901
|
+
* ```ts
|
|
1902
|
+
* import { changePenShadeBy } from 'hikkaku/blocks'
|
|
1903
|
+
*
|
|
1904
|
+
* changePenShadeBy(10)
|
|
1905
|
+
* ```
|
|
1906
|
+
*/
|
|
138
1907
|
declare const changePenShadeBy: (shade: PrimitiveSource<number>) => HikkakuBlock;
|
|
1908
|
+
/**
|
|
1909
|
+
* Sets pen hue to value.
|
|
1910
|
+
*
|
|
1911
|
+
* Input: `hue`.
|
|
1912
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1913
|
+
*
|
|
1914
|
+
* @param hue See function signature for accepted input values.
|
|
1915
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1916
|
+
* @example
|
|
1917
|
+
* ```ts
|
|
1918
|
+
* import { setPenHueToNumber } from 'hikkaku/blocks'
|
|
1919
|
+
*
|
|
1920
|
+
* setPenHueToNumber(10)
|
|
1921
|
+
* ```
|
|
1922
|
+
*/
|
|
139
1923
|
declare const setPenHueToNumber: (hue: PrimitiveSource<number>) => HikkakuBlock;
|
|
1924
|
+
/**
|
|
1925
|
+
* Changes pen hue by amount.
|
|
1926
|
+
*
|
|
1927
|
+
* Input: `hue`.
|
|
1928
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
1929
|
+
*
|
|
1930
|
+
* @param hue See function signature for accepted input values.
|
|
1931
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
1932
|
+
* @example
|
|
1933
|
+
* ```ts
|
|
1934
|
+
* import { changePenHueBy } from 'hikkaku/blocks'
|
|
1935
|
+
*
|
|
1936
|
+
* changePenHueBy(10)
|
|
1937
|
+
* ```
|
|
1938
|
+
*/
|
|
140
1939
|
declare const changePenHueBy: (hue: PrimitiveSource<number>) => HikkakuBlock;
|
|
141
1940
|
//#endregion
|
|
142
1941
|
//#region src/blocks/procedures.d.ts
|
|
@@ -154,8 +1953,44 @@ interface ProcedureProcStringOrNumber<T = string> {
|
|
|
154
1953
|
name: T;
|
|
155
1954
|
}
|
|
156
1955
|
type ProcedureProc = ProcedureProcLabel | ProcedureProcBoolean | ProcedureProcStringOrNumber;
|
|
1956
|
+
/**
|
|
1957
|
+
* Creates a label fragment used in `defineProcedure`.
|
|
1958
|
+
*
|
|
1959
|
+
* @param text Static text shown in the custom block signature.
|
|
1960
|
+
* @returns A procedure fragment describing a label segment.
|
|
1961
|
+
* @example
|
|
1962
|
+
* ```ts
|
|
1963
|
+
* import { procedureLabel } from 'hikkaku/blocks'
|
|
1964
|
+
*
|
|
1965
|
+
* procedureLabel('Hello')
|
|
1966
|
+
* ```
|
|
1967
|
+
*/
|
|
157
1968
|
declare const procedureLabel: (text: string) => ProcedureProcLabel;
|
|
1969
|
+
/**
|
|
1970
|
+
* Creates a boolean argument fragment used in `defineProcedure`.
|
|
1971
|
+
*
|
|
1972
|
+
* @param name Argument name shown in the custom block signature.
|
|
1973
|
+
* @returns A procedure fragment describing a boolean input.
|
|
1974
|
+
* @example
|
|
1975
|
+
* ```ts
|
|
1976
|
+
* import { procedureBoolean } from 'hikkaku/blocks'
|
|
1977
|
+
*
|
|
1978
|
+
* procedureBoolean(undefined as any)
|
|
1979
|
+
* ```
|
|
1980
|
+
*/
|
|
158
1981
|
declare const procedureBoolean: <T extends string>(name: T) => ProcedureProcBoolean<T>;
|
|
1982
|
+
/**
|
|
1983
|
+
* Creates a string/number argument fragment used in `defineProcedure`.
|
|
1984
|
+
*
|
|
1985
|
+
* @param name Argument name shown in the custom block signature.
|
|
1986
|
+
* @returns A procedure fragment describing a string/number input.
|
|
1987
|
+
* @example
|
|
1988
|
+
* ```ts
|
|
1989
|
+
* import { procedureStringOrNumber } from 'hikkaku/blocks'
|
|
1990
|
+
*
|
|
1991
|
+
* procedureStringOrNumber(undefined as any)
|
|
1992
|
+
* ```
|
|
1993
|
+
*/
|
|
159
1994
|
declare const procedureStringOrNumber: <T extends string>(name: T) => ProcedureProcStringOrNumber<T>;
|
|
160
1995
|
type OnlyArgProc<T> = T extends {
|
|
161
1996
|
type: 'label';
|
|
@@ -165,6 +2000,10 @@ interface ProcedureReferenceBase {
|
|
|
165
2000
|
name: string;
|
|
166
2001
|
type: 'boolean' | 'stringOrNumber';
|
|
167
2002
|
id: string;
|
|
2003
|
+
/**
|
|
2004
|
+
* Creates a reporter block for this argument reference.
|
|
2005
|
+
*/
|
|
2006
|
+
getter(): HikkakuBlock;
|
|
168
2007
|
}
|
|
169
2008
|
interface ProcedureBooleanReference extends ProcedureReferenceBase {
|
|
170
2009
|
type: 'boolean';
|
|
@@ -173,53 +2012,548 @@ interface ProcedureStringOrNumberReference extends ProcedureReferenceBase {
|
|
|
173
2012
|
type: 'stringOrNumber';
|
|
174
2013
|
}
|
|
175
2014
|
type ProcedureReference = ProcedureBooleanReference | ProcedureStringOrNumberReference;
|
|
2015
|
+
interface ProcedureDefinitionReference<T extends ProcedureProc[] = ProcedureProc[]> {
|
|
2016
|
+
type: 'procedure';
|
|
2017
|
+
proccode: string;
|
|
2018
|
+
warp: boolean;
|
|
2019
|
+
argumentids: string[];
|
|
2020
|
+
arguments: ReferencesByProcs<T>;
|
|
2021
|
+
}
|
|
2022
|
+
type ProcedureCallInput = {
|
|
2023
|
+
reference: ProcedureReference;
|
|
2024
|
+
value: PrimitiveSource<string | number | boolean>;
|
|
2025
|
+
};
|
|
2026
|
+
interface ProcedureDefinition<T extends ProcedureProc[] = ProcedureProc[]> extends HikkakuBlock {
|
|
2027
|
+
reference: ProcedureDefinitionReference<T>;
|
|
2028
|
+
}
|
|
176
2029
|
type ReferencesByProcs<T extends ProcedureProc[]> = { [K in OnlyArgProc<T[number]>['name']]: OnlyArgProc<T[number]> extends {
|
|
177
2030
|
type: infer U;
|
|
178
2031
|
} ? U extends 'boolean' ? ProcedureBooleanReference : U extends 'stringOrNumber' ? ProcedureStringOrNumberReference : never : never };
|
|
179
|
-
|
|
2032
|
+
/**
|
|
2033
|
+
* Defines a custom procedure and returns its definition block.
|
|
2034
|
+
*
|
|
2035
|
+
* @param proclist List of procedure parts (labels and arguments) that define the procedure's signature.
|
|
2036
|
+
* @param stack Optional callback that composes the procedure body. Return `undefined` from this callback (implicit return is fine).
|
|
2037
|
+
* Argument references include `getter()` to create reporter blocks.
|
|
2038
|
+
* @param warp If `true`, run the procedure without screen refresh until completion.
|
|
2039
|
+
* @returns A procedure definition block with `reference` metadata for safe calls.
|
|
2040
|
+
* @example
|
|
2041
|
+
* ```ts
|
|
2042
|
+
* import { defineProcedure, procedureLabel, procedureStringOrNumber, say } from 'hikkaku/blocks'
|
|
2043
|
+
*
|
|
2044
|
+
* const greet = defineProcedure(
|
|
2045
|
+
* [procedureLabel('greet'), procedureStringOrNumber('name')],
|
|
2046
|
+
* ({ name }) => {
|
|
2047
|
+
* say(name.getter())
|
|
2048
|
+
* },
|
|
2049
|
+
* )
|
|
2050
|
+
* ```
|
|
2051
|
+
*/
|
|
2052
|
+
declare const defineProcedure: <T extends ProcedureProc[]>(proclist: T, stack?: (references: ReferencesByProcs<T>) => undefined,
|
|
180
2053
|
/**
|
|
181
2054
|
* If true, the procedure will run without screen refresh until it completes.
|
|
182
2055
|
* This can make the procedure run faster, but the screen will not update until the procedure is done.
|
|
183
2056
|
*/
|
|
184
2057
|
|
|
185
|
-
warp?: boolean) =>
|
|
186
|
-
|
|
2058
|
+
warp?: boolean) => ProcedureDefinition<T>;
|
|
2059
|
+
/**
|
|
2060
|
+
* Calls a custom procedure.
|
|
2061
|
+
* Supports three call styles:
|
|
2062
|
+
* 1) Low-level: `callProcedure(proccode, argumentIds, inputs?, warp?)`
|
|
2063
|
+
* 2) Reference + array: `callProcedure(definitionOrReference, [{ reference, value }], warp?)`
|
|
2064
|
+
* 3) Reference + object: `callProcedure(definitionOrReference, { [argumentId]: value }, warp?)`
|
|
2065
|
+
*
|
|
2066
|
+
* @param proccodeOrReference Procedure code or the definition/reference returned by `defineProcedure`.
|
|
2067
|
+
* @param argumentIdsOrInputs Argument IDs for low-level calls, or argument inputs for reference-based calls.
|
|
2068
|
+
* @param inputsOrWarp Optional low-level inputs object or a warp override for reference-based calls.
|
|
2069
|
+
* @param warp Warp flag used by low-level calls.
|
|
2070
|
+
* @returns A `procedures_call` block.
|
|
2071
|
+
* @example
|
|
2072
|
+
* ```ts
|
|
2073
|
+
* import { callProcedure, defineProcedure, procedureLabel, procedureStringOrNumber } from 'hikkaku/blocks'
|
|
2074
|
+
*
|
|
2075
|
+
* const greet = defineProcedure([
|
|
2076
|
+
* procedureLabel('greet'),
|
|
2077
|
+
* procedureStringOrNumber('name'),
|
|
2078
|
+
* ])
|
|
2079
|
+
*
|
|
2080
|
+
* callProcedure(greet, [
|
|
2081
|
+
* { reference: greet.reference.arguments.name, value: 'Ada' },
|
|
2082
|
+
* ])
|
|
2083
|
+
* ```
|
|
2084
|
+
*/
|
|
2085
|
+
declare const callProcedure: (proccodeOrReference: string | ProcedureDefinitionReference | ProcedureDefinition, argumentIdsOrInputs: string[] | ProcedureCallInput[] | Record<string, PrimitiveSource<string | number | boolean>>, inputsOrWarp?: Record<string, PrimitiveSource<string | number | boolean>> | boolean, warp?: boolean) => HikkakuBlock;
|
|
2086
|
+
/**
|
|
2087
|
+
* Creates a reporter block for a string/number procedure argument.
|
|
2088
|
+
*
|
|
2089
|
+
* @param reference String/number argument reference from `defineProcedure`.
|
|
2090
|
+
* @returns A reporter block that reads the current argument value.
|
|
2091
|
+
* @example
|
|
2092
|
+
* ```ts
|
|
2093
|
+
* import { argumentReporterStringNumber } from 'hikkaku/blocks'
|
|
2094
|
+
*
|
|
2095
|
+
* argumentReporterStringNumber(reference as any)
|
|
2096
|
+
* ```
|
|
2097
|
+
*/
|
|
187
2098
|
declare const argumentReporterStringNumber: (reference: ProcedureStringOrNumberReference) => HikkakuBlock;
|
|
2099
|
+
/**
|
|
2100
|
+
* Creates a reporter block for a boolean procedure argument.
|
|
2101
|
+
*
|
|
2102
|
+
* @param reference Boolean argument reference from `defineProcedure`.
|
|
2103
|
+
* @returns A reporter block that reads the current argument value.
|
|
2104
|
+
* @example
|
|
2105
|
+
* ```ts
|
|
2106
|
+
* import { argumentReporterBoolean } from 'hikkaku/blocks'
|
|
2107
|
+
*
|
|
2108
|
+
* argumentReporterBoolean(reference as any)
|
|
2109
|
+
* ```
|
|
2110
|
+
*/
|
|
188
2111
|
declare const argumentReporterBoolean: (reference: ProcedureBooleanReference) => HikkakuBlock;
|
|
189
2112
|
//#endregion
|
|
190
2113
|
//#region src/blocks/sensing.d.ts
|
|
2114
|
+
/**
|
|
2115
|
+
* Mouse position.
|
|
2116
|
+
*
|
|
2117
|
+
* Input: none.
|
|
2118
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2119
|
+
*
|
|
2120
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2121
|
+
* @example
|
|
2122
|
+
* ```ts
|
|
2123
|
+
* import { getMouseX } from 'hikkaku/blocks'
|
|
2124
|
+
*
|
|
2125
|
+
* getMouseX()
|
|
2126
|
+
* ```
|
|
2127
|
+
*/
|
|
191
2128
|
declare const getMouseX: () => HikkakuBlock;
|
|
2129
|
+
/**
|
|
2130
|
+
* getMouseY block helper.
|
|
2131
|
+
*
|
|
2132
|
+
* Input: none.
|
|
2133
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2134
|
+
*
|
|
2135
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2136
|
+
* @example
|
|
2137
|
+
* ```ts
|
|
2138
|
+
* import { getMouseY } from 'hikkaku/blocks'
|
|
2139
|
+
*
|
|
2140
|
+
* getMouseY()
|
|
2141
|
+
* ```
|
|
2142
|
+
*/
|
|
192
2143
|
declare const getMouseY: () => HikkakuBlock;
|
|
193
2144
|
type CurrentMenu = 'year' | 'month' | 'date' | 'dayofweek' | 'hour' | 'minute' | 'second';
|
|
194
2145
|
type DragMode = 'draggable' | 'not draggable';
|
|
2146
|
+
/**
|
|
2147
|
+
* Touching target check.
|
|
2148
|
+
*
|
|
2149
|
+
* Input: `target`.
|
|
2150
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2151
|
+
*
|
|
2152
|
+
* @param target See function signature for accepted input values.
|
|
2153
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2154
|
+
* @example
|
|
2155
|
+
* ```ts
|
|
2156
|
+
* import { touchingObject } from 'hikkaku/blocks'
|
|
2157
|
+
*
|
|
2158
|
+
* touchingObject('mouse-pointer')
|
|
2159
|
+
* ```
|
|
2160
|
+
*/
|
|
195
2161
|
declare const touchingObject: (target: string) => HikkakuBlock;
|
|
2162
|
+
/**
|
|
2163
|
+
* Touching color check.
|
|
2164
|
+
*
|
|
2165
|
+
* Input: `color`.
|
|
2166
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2167
|
+
*
|
|
2168
|
+
* @param color See function signature for accepted input values.
|
|
2169
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2170
|
+
* @example
|
|
2171
|
+
* ```ts
|
|
2172
|
+
* import { touchingColor } from 'hikkaku/blocks'
|
|
2173
|
+
*
|
|
2174
|
+
* touchingColor(undefined as any)
|
|
2175
|
+
* ```
|
|
2176
|
+
*/
|
|
196
2177
|
declare const touchingColor: (color: PrimitiveSource<string>) => HikkakuBlock;
|
|
2178
|
+
/**
|
|
2179
|
+
* Color overlap check.
|
|
2180
|
+
*
|
|
2181
|
+
* Input: `color`, `targetColor`.
|
|
2182
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2183
|
+
*
|
|
2184
|
+
* @param color See function signature for accepted input values.
|
|
2185
|
+
* @param targetColor See function signature for accepted input values.
|
|
2186
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2187
|
+
* @example
|
|
2188
|
+
* ```ts
|
|
2189
|
+
* import { colorTouchingColor } from 'hikkaku/blocks'
|
|
2190
|
+
*
|
|
2191
|
+
* colorTouchingColor(undefined as any, undefined as any)
|
|
2192
|
+
* ```
|
|
2193
|
+
*/
|
|
197
2194
|
declare const colorTouchingColor: (color: PrimitiveSource<string>, targetColor: PrimitiveSource<string>) => HikkakuBlock;
|
|
2195
|
+
/**
|
|
2196
|
+
* Distance to target.
|
|
2197
|
+
*
|
|
2198
|
+
* Input: `target`.
|
|
2199
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2200
|
+
*
|
|
2201
|
+
* @param target See function signature for accepted input values.
|
|
2202
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2203
|
+
* @example
|
|
2204
|
+
* ```ts
|
|
2205
|
+
* import { distanceTo } from 'hikkaku/blocks'
|
|
2206
|
+
*
|
|
2207
|
+
* distanceTo('mouse-pointer')
|
|
2208
|
+
* ```
|
|
2209
|
+
*/
|
|
198
2210
|
declare const distanceTo: (target: string) => HikkakuBlock;
|
|
2211
|
+
/**
|
|
2212
|
+
* Timer value.
|
|
2213
|
+
*
|
|
2214
|
+
* Input: none.
|
|
2215
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2216
|
+
*
|
|
2217
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2218
|
+
* @example
|
|
2219
|
+
* ```ts
|
|
2220
|
+
* import { getTimer } from 'hikkaku/blocks'
|
|
2221
|
+
*
|
|
2222
|
+
* getTimer()
|
|
2223
|
+
* ```
|
|
2224
|
+
*/
|
|
199
2225
|
declare const getTimer: () => HikkakuBlock;
|
|
2226
|
+
/**
|
|
2227
|
+
* Resets timer.
|
|
2228
|
+
*
|
|
2229
|
+
* Input: none.
|
|
2230
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
2231
|
+
*
|
|
2232
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
2233
|
+
* @example
|
|
2234
|
+
* ```ts
|
|
2235
|
+
* import { resetTimer } from 'hikkaku/blocks'
|
|
2236
|
+
*
|
|
2237
|
+
* resetTimer()
|
|
2238
|
+
* ```
|
|
2239
|
+
*/
|
|
200
2240
|
declare const resetTimer: () => HikkakuBlock;
|
|
2241
|
+
/**
|
|
2242
|
+
* Sets drag behavior.
|
|
2243
|
+
*
|
|
2244
|
+
* Input: `mode`.
|
|
2245
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
2246
|
+
*
|
|
2247
|
+
* @param mode See function signature for accepted input values.
|
|
2248
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
2249
|
+
* @example
|
|
2250
|
+
* ```ts
|
|
2251
|
+
* import { setDragMode } from 'hikkaku/blocks'
|
|
2252
|
+
*
|
|
2253
|
+
* setDragMode('draggable')
|
|
2254
|
+
* ```
|
|
2255
|
+
*/
|
|
201
2256
|
declare const setDragMode: (mode: DragMode) => HikkakuBlock;
|
|
2257
|
+
/**
|
|
2258
|
+
* Mouse button state.
|
|
2259
|
+
*
|
|
2260
|
+
* Input: none.
|
|
2261
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2262
|
+
*
|
|
2263
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2264
|
+
* @example
|
|
2265
|
+
* ```ts
|
|
2266
|
+
* import { getMouseDown } from 'hikkaku/blocks'
|
|
2267
|
+
*
|
|
2268
|
+
* getMouseDown()
|
|
2269
|
+
* ```
|
|
2270
|
+
*/
|
|
202
2271
|
declare const getMouseDown: () => HikkakuBlock;
|
|
2272
|
+
/**
|
|
2273
|
+
* Key state.
|
|
2274
|
+
*
|
|
2275
|
+
* Input: `key`.
|
|
2276
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2277
|
+
*
|
|
2278
|
+
* @param key See function signature for accepted input values.
|
|
2279
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2280
|
+
* @example
|
|
2281
|
+
* ```ts
|
|
2282
|
+
* import { getKeyPressed } from 'hikkaku/blocks'
|
|
2283
|
+
*
|
|
2284
|
+
* getKeyPressed('space')
|
|
2285
|
+
* ```
|
|
2286
|
+
*/
|
|
203
2287
|
declare const getKeyPressed: (key: PrimitiveSource<string>) => HikkakuBlock;
|
|
2288
|
+
/**
|
|
2289
|
+
* Current date/time value.
|
|
2290
|
+
*
|
|
2291
|
+
* Input: `menu`.
|
|
2292
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2293
|
+
*
|
|
2294
|
+
* @param menu See function signature for accepted input values.
|
|
2295
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2296
|
+
* @example
|
|
2297
|
+
* ```ts
|
|
2298
|
+
* import { current } from 'hikkaku/blocks'
|
|
2299
|
+
*
|
|
2300
|
+
* current('loudness')
|
|
2301
|
+
* ```
|
|
2302
|
+
*/
|
|
204
2303
|
declare const current: (menu: CurrentMenu) => HikkakuBlock;
|
|
2304
|
+
/**
|
|
2305
|
+
* Reads target attribute.
|
|
2306
|
+
*
|
|
2307
|
+
* Input: `property`, `target`.
|
|
2308
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2309
|
+
*
|
|
2310
|
+
* @param property See function signature for accepted input values.
|
|
2311
|
+
* @param target See function signature for accepted input values.
|
|
2312
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2313
|
+
* @example
|
|
2314
|
+
* ```ts
|
|
2315
|
+
* import { getAttributeOf } from 'hikkaku/blocks'
|
|
2316
|
+
*
|
|
2317
|
+
* getAttributeOf(undefined as any, 'mouse-pointer')
|
|
2318
|
+
* ```
|
|
2319
|
+
*/
|
|
205
2320
|
declare const getAttributeOf: (property: string, target: string) => HikkakuBlock;
|
|
2321
|
+
/**
|
|
2322
|
+
* Days since 2000-01-01.
|
|
2323
|
+
*
|
|
2324
|
+
* Input: none.
|
|
2325
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2326
|
+
*
|
|
2327
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2328
|
+
* @example
|
|
2329
|
+
* ```ts
|
|
2330
|
+
* import { daysSince2000 } from 'hikkaku/blocks'
|
|
2331
|
+
*
|
|
2332
|
+
* daysSince2000()
|
|
2333
|
+
* ```
|
|
2334
|
+
*/
|
|
206
2335
|
declare const daysSince2000: () => HikkakuBlock;
|
|
2336
|
+
/**
|
|
2337
|
+
* Microphone loudness.
|
|
2338
|
+
*
|
|
2339
|
+
* Input: none.
|
|
2340
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2341
|
+
*
|
|
2342
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2343
|
+
* @example
|
|
2344
|
+
* ```ts
|
|
2345
|
+
* import { getLoudness } from 'hikkaku/blocks'
|
|
2346
|
+
*
|
|
2347
|
+
* getLoudness()
|
|
2348
|
+
* ```
|
|
2349
|
+
*/
|
|
207
2350
|
declare const getLoudness: () => HikkakuBlock;
|
|
2351
|
+
/**
|
|
2352
|
+
* isLoud block helper.
|
|
2353
|
+
*
|
|
2354
|
+
* Input: none.
|
|
2355
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2356
|
+
*
|
|
2357
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2358
|
+
* @example
|
|
2359
|
+
* ```ts
|
|
2360
|
+
* import { isLoud } from 'hikkaku/blocks'
|
|
2361
|
+
*
|
|
2362
|
+
* isLoud()
|
|
2363
|
+
* ```
|
|
2364
|
+
*/
|
|
208
2365
|
declare const isLoud: () => HikkakuBlock;
|
|
2366
|
+
/**
|
|
2367
|
+
* Asks user input.
|
|
2368
|
+
*
|
|
2369
|
+
* Input: `question`.
|
|
2370
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
2371
|
+
*
|
|
2372
|
+
* @param question See function signature for accepted input values.
|
|
2373
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
2374
|
+
* @example
|
|
2375
|
+
* ```ts
|
|
2376
|
+
* import { askAndWait } from 'hikkaku/blocks'
|
|
2377
|
+
*
|
|
2378
|
+
* askAndWait('Hello')
|
|
2379
|
+
* ```
|
|
2380
|
+
*/
|
|
209
2381
|
declare const askAndWait: (question: PrimitiveSource<string>) => HikkakuBlock;
|
|
2382
|
+
/**
|
|
2383
|
+
* Returns last answer.
|
|
2384
|
+
*
|
|
2385
|
+
* Input: none.
|
|
2386
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2387
|
+
*
|
|
2388
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2389
|
+
* @example
|
|
2390
|
+
* ```ts
|
|
2391
|
+
* import { getAnswer } from 'hikkaku/blocks'
|
|
2392
|
+
*
|
|
2393
|
+
* getAnswer()
|
|
2394
|
+
* ```
|
|
2395
|
+
*/
|
|
210
2396
|
declare const getAnswer: () => HikkakuBlock;
|
|
2397
|
+
/**
|
|
2398
|
+
* Returns username.
|
|
2399
|
+
*
|
|
2400
|
+
* Input: none.
|
|
2401
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2402
|
+
*
|
|
2403
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2404
|
+
* @example
|
|
2405
|
+
* ```ts
|
|
2406
|
+
* import { getUsername } from 'hikkaku/blocks'
|
|
2407
|
+
*
|
|
2408
|
+
* getUsername()
|
|
2409
|
+
* ```
|
|
2410
|
+
*/
|
|
211
2411
|
declare const getUsername: () => HikkakuBlock;
|
|
212
2412
|
//#endregion
|
|
213
2413
|
//#region src/blocks/sound.d.ts
|
|
214
2414
|
type SoundEffect = 'pitch' | 'pan';
|
|
2415
|
+
/**
|
|
2416
|
+
* Plays sound.
|
|
2417
|
+
*
|
|
2418
|
+
* Input: `sound`.
|
|
2419
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
2420
|
+
*
|
|
2421
|
+
* @param sound See function signature for accepted input values.
|
|
2422
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
2423
|
+
* @example
|
|
2424
|
+
* ```ts
|
|
2425
|
+
* import { playSound } from 'hikkaku/blocks'
|
|
2426
|
+
*
|
|
2427
|
+
* playSound('pop')
|
|
2428
|
+
* ```
|
|
2429
|
+
*/
|
|
215
2430
|
declare const playSound: (sound: SoundSource) => HikkakuBlock;
|
|
2431
|
+
/**
|
|
2432
|
+
* Plays and waits.
|
|
2433
|
+
*
|
|
2434
|
+
* Input: `sound`.
|
|
2435
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
2436
|
+
*
|
|
2437
|
+
* @param sound See function signature for accepted input values.
|
|
2438
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
2439
|
+
* @example
|
|
2440
|
+
* ```ts
|
|
2441
|
+
* import { playSoundUntilDone } from 'hikkaku/blocks'
|
|
2442
|
+
*
|
|
2443
|
+
* playSoundUntilDone('pop')
|
|
2444
|
+
* ```
|
|
2445
|
+
*/
|
|
216
2446
|
declare const playSoundUntilDone: (sound: SoundSource) => HikkakuBlock;
|
|
2447
|
+
/**
|
|
2448
|
+
* Stops all sounds.
|
|
2449
|
+
*
|
|
2450
|
+
* Input: none.
|
|
2451
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
2452
|
+
*
|
|
2453
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
2454
|
+
* @example
|
|
2455
|
+
* ```ts
|
|
2456
|
+
* import { stopAllSounds } from 'hikkaku/blocks'
|
|
2457
|
+
*
|
|
2458
|
+
* stopAllSounds()
|
|
2459
|
+
* ```
|
|
2460
|
+
*/
|
|
217
2461
|
declare const stopAllSounds: () => HikkakuBlock;
|
|
2462
|
+
/**
|
|
2463
|
+
* Sets sound effect.
|
|
2464
|
+
*
|
|
2465
|
+
* Input: `effect`, `value`.
|
|
2466
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
2467
|
+
*
|
|
2468
|
+
* @param effect See function signature for accepted input values.
|
|
2469
|
+
* @param value See function signature for accepted input values.
|
|
2470
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
2471
|
+
* @example
|
|
2472
|
+
* ```ts
|
|
2473
|
+
* import { setSoundEffectTo } from 'hikkaku/blocks'
|
|
2474
|
+
*
|
|
2475
|
+
* setSoundEffectTo('pitch', 10)
|
|
2476
|
+
* ```
|
|
2477
|
+
*/
|
|
218
2478
|
declare const setSoundEffectTo: (effect: SoundEffect, value: PrimitiveSource<number>) => HikkakuBlock;
|
|
2479
|
+
/**
|
|
2480
|
+
* Changes sound effect.
|
|
2481
|
+
*
|
|
2482
|
+
* Input: `effect`, `value`.
|
|
2483
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
2484
|
+
*
|
|
2485
|
+
* @param effect See function signature for accepted input values.
|
|
2486
|
+
* @param value See function signature for accepted input values.
|
|
2487
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
2488
|
+
* @example
|
|
2489
|
+
* ```ts
|
|
2490
|
+
* import { changeSoundEffectBy } from 'hikkaku/blocks'
|
|
2491
|
+
*
|
|
2492
|
+
* changeSoundEffectBy('pitch', 10)
|
|
2493
|
+
* ```
|
|
2494
|
+
*/
|
|
219
2495
|
declare const changeSoundEffectBy: (effect: SoundEffect, value: PrimitiveSource<number>) => HikkakuBlock;
|
|
2496
|
+
/**
|
|
2497
|
+
* Clears sound effects.
|
|
2498
|
+
*
|
|
2499
|
+
* Input: none.
|
|
2500
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
2501
|
+
*
|
|
2502
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
2503
|
+
* @example
|
|
2504
|
+
* ```ts
|
|
2505
|
+
* import { clearEffects } from 'hikkaku/blocks'
|
|
2506
|
+
*
|
|
2507
|
+
* clearEffects()
|
|
2508
|
+
* ```
|
|
2509
|
+
*/
|
|
220
2510
|
declare const clearEffects: () => HikkakuBlock;
|
|
2511
|
+
/**
|
|
2512
|
+
* Sets volume.
|
|
2513
|
+
*
|
|
2514
|
+
* Input: `value`.
|
|
2515
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
2516
|
+
*
|
|
2517
|
+
* @param value See function signature for accepted input values.
|
|
2518
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
2519
|
+
* @example
|
|
2520
|
+
* ```ts
|
|
2521
|
+
* import { setVolumeTo } from 'hikkaku/blocks'
|
|
2522
|
+
*
|
|
2523
|
+
* setVolumeTo(10)
|
|
2524
|
+
* ```
|
|
2525
|
+
*/
|
|
221
2526
|
declare const setVolumeTo: (value: PrimitiveSource<number>) => HikkakuBlock;
|
|
2527
|
+
/**
|
|
2528
|
+
* Changes volume.
|
|
2529
|
+
*
|
|
2530
|
+
* Input: `value`.
|
|
2531
|
+
* Output: Scratch statement block definition that is appended to the current script stack.
|
|
2532
|
+
*
|
|
2533
|
+
* @param value See function signature for accepted input values.
|
|
2534
|
+
* @returns Scratch statement block definition that is appended to the current script stack.
|
|
2535
|
+
* @example
|
|
2536
|
+
* ```ts
|
|
2537
|
+
* import { changeVolumeBy } from 'hikkaku/blocks'
|
|
2538
|
+
*
|
|
2539
|
+
* changeVolumeBy(10)
|
|
2540
|
+
* ```
|
|
2541
|
+
*/
|
|
222
2542
|
declare const changeVolumeBy: (value: PrimitiveSource<number>) => HikkakuBlock;
|
|
2543
|
+
/**
|
|
2544
|
+
* Returns volume.
|
|
2545
|
+
*
|
|
2546
|
+
* Input: none.
|
|
2547
|
+
* Output: Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2548
|
+
*
|
|
2549
|
+
* @returns Scratch reporter block definition that can be used as an input value in other blocks.
|
|
2550
|
+
* @example
|
|
2551
|
+
* ```ts
|
|
2552
|
+
* import { getVolume } from 'hikkaku/blocks'
|
|
2553
|
+
*
|
|
2554
|
+
* getVolume()
|
|
2555
|
+
* ```
|
|
2556
|
+
*/
|
|
223
2557
|
declare const getVolume: () => HikkakuBlock;
|
|
224
2558
|
//#endregion
|
|
225
|
-
export { CREATE_CLONE_MYSELF, CurrentMenu, DragMode, ForwardBackward, FrontBack, ListIndex, LookEffect, MathOpOperator, NumberName, PenColorParam, ProcedureArgumentDefault, ProcedureBooleanReference, ProcedureProc, ProcedureProcBoolean, ProcedureProcLabel, ProcedureProcStringOrNumber, ProcedureReference, ProcedureReferenceBase, ProcedureStringOrNumberReference, SoundEffect, StopOption, add, addToList, allAtOnce, and, argumentReporterBoolean, argumentReporterStringNumber, askAndWait, broadcast, broadcastAndWait, callProcedure, changeLooksEffectBy, changePenColorParamBy, changePenHueBy, changePenShadeBy, changePenSizeBy, changeSizeBy, changeSoundEffectBy, changeVariableBy, changeVolumeBy, changeXBy, changeYBy, clear, clearCounter, clearEffects, clearGraphicEffects, colorTouchingColor, contains, controlStartAsClone, createClone, current, daysSince2000, defineProcedure, deleteAllOfList, deleteOfList, deleteThisClone, distanceTo, divide, equals, eraseAll, forEach, forever, getAnswer, getAttributeOf, getBackdropNumberName, getCostumeNumberName, getCounter, getDirection, getItemNumOfList, getItemOfList, getKeyPressed, getListContents, getLoudness, getMouseDown, getMouseX, getMouseY, getSize, getTimer, getUsername, getVariable, getVolume, getX, getY, glide, glideTo, goForwardBackwardLayers, goTo, goToFrontBack, gotoXY, gt, hide, hideList, hideVariable, ifElse, ifOnEdgeBounce, ifThen, incrCounter, insertAtList, isLoud, join, length, lengthOfList, letterOf, listContainsItem, lt, mathop, mod, moveSteps, multiply, nextBackdrop, nextCostume, not, or, penDown, penUp, playSound, playSoundUntilDone, pointInDirection, pointTowards, procedureBoolean, procedureLabel, procedureStringOrNumber, random, repeat, repeatUntil, repeatWhile, replaceItemOfList, resetTimer, round, say, sayForSecs, setDragMode, setLooksEffectTo, setPenColorParamTo, setPenColorTo, setPenColorToColor, setPenHueToNumber, setPenShadeToNumber, setPenSizeTo, setRotationStyle, setSizeTo, setSoundEffectTo, setVariableTo, setVolumeTo, setX, setY, show, showList, showVariable, stamp, stop, stopAllSounds, subtract, switchBackdropTo, switchBackdropToAndWait, switchCostumeTo, think, thinkForSecs, touchingColor, touchingObject, turnLeft, turnRight, wait, waitUntil, whenBackdropSwitchesTo, whenBroadcastReceived, whenFlagClicked, whenGreaterThan, whenKeyPressed, whenStageClicked, whenThisSpriteClicked, whenTouchingObject };
|
|
2559
|
+
export { CREATE_CLONE_MYSELF, CurrentMenu, DragMode, ForwardBackward, FrontBack, ListIndex, LookEffect, MathOpOperator, NumberName, PenColorParam, ProcedureArgumentDefault, ProcedureBooleanReference, ProcedureCallInput, ProcedureDefinition, ProcedureDefinitionReference, ProcedureProc, ProcedureProcBoolean, ProcedureProcLabel, ProcedureProcStringOrNumber, ProcedureReference, ProcedureReferenceBase, ProcedureStringOrNumberReference, SoundEffect, StopOption, add, addToList, allAtOnce, and, argumentReporterBoolean, argumentReporterStringNumber, askAndWait, broadcast, broadcastAndWait, callProcedure, changeLooksEffectBy, changePenColorParamBy, changePenHueBy, changePenShadeBy, changePenSizeBy, changeSizeBy, changeSoundEffectBy, changeVariableBy, changeVolumeBy, changeXBy, changeYBy, clear, clearCounter, clearEffects, clearGraphicEffects, colorTouchingColor, contains, controlStartAsClone, createClone, current, daysSince2000, defineProcedure, deleteAllOfList, deleteOfList, deleteThisClone, distanceTo, divide, equals, eraseAll, forEach, forever, getAnswer, getAttributeOf, getBackdropNumberName, getCostumeNumberName, getCounter, getDirection, getItemNumOfList, getItemOfList, getKeyPressed, getListContents, getLoudness, getMouseDown, getMouseX, getMouseY, getSize, getTimer, getUsername, getVariable, getVolume, getX, getY, glide, glideTo, goForwardBackwardLayers, goTo, goToFrontBack, gotoXY, gt, hide, hideList, hideVariable, ifElse, ifOnEdgeBounce, ifThen, incrCounter, insertAtList, isLoud, join, length, lengthOfList, letterOf, listContainsItem, lt, match, mathop, mod, moveSteps, multiply, nextBackdrop, nextCostume, not, or, penDown, penUp, playSound, playSoundUntilDone, pointInDirection, pointTowards, procedureBoolean, procedureLabel, procedureStringOrNumber, random, repeat, repeatUntil, repeatWhile, replaceItemOfList, resetTimer, round, say, sayForSecs, setDragMode, setLooksEffectTo, setPenColorParamTo, setPenColorTo, setPenColorToColor, setPenHueToNumber, setPenShadeToNumber, setPenSizeTo, setRotationStyle, setSizeTo, setSoundEffectTo, setVariableTo, setVolumeTo, setX, setY, show, showList, showVariable, stamp, stop, stopAllSounds, subtract, switchBackdropTo, switchBackdropToAndWait, switchCostumeTo, think, thinkForSecs, touchingColor, touchingObject, turnLeft, turnRight, wait, waitUntil, whenBackdropSwitchesTo, whenBroadcastReceived, whenFlagClicked, whenGreaterThan, whenKeyPressed, whenStageClicked, whenThisSpriteClicked, whenTouchingObject };
|