Skip to content

Commit 8cf0676

Browse files
🤖 dprint fmt
1 parent fa0a549 commit 8cf0676

File tree

10 files changed

+33
-31
lines changed

10 files changed

+33
-31
lines changed

types/mokapi/faker.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,4 +396,4 @@ export interface Schema {
396396

397397
/** Specifies whether all items in an array must be unique. */
398398
uniqueItems?: boolean;
399-
}
399+
}

types/mokapi/global.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ declare global {
2424
*/
2525
as: "binary" | "string" | "resolved";
2626
}
27-
}
27+
}

types/mokapi/http.d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export function options(url: string, body?: JSONValue, args?: Args): Response;
113113
* maxRedirects: 2
114114
* });
115115
*/
116-
export function fetch(url: string, opts?: FetchOptions): Promise<Response>
116+
export function fetch(url: string, opts?: FetchOptions): Promise<Response>;
117117

118118
/**
119119
* Request arguments.
@@ -125,16 +125,16 @@ export interface Args {
125125
/**
126126
* The number of redirects to follow for this request.
127127
* @default 5
128-
**/
129-
maxRedirects?: number
128+
*/
129+
maxRedirects?: number;
130130
/**
131131
* Maximum time to wait for the request to complete. Default
132132
* timeout is 60 seconds ("60s"). The type can also be a number, in which
133133
* case Mokapi interprets it as milliseconds
134134
* @example
135135
* const res = get(url, { timeout: '5m' })
136136
*/
137-
timeout?: number | string
137+
timeout?: number | string;
138138
}
139139

140140
/**
@@ -147,14 +147,14 @@ export interface FetchOptions {
147147
* @example
148148
* const res = await fetch(url, { method: 'POST' });
149149
*/
150-
method?: string
150+
method?: string;
151151

152152
/**
153153
* The body of the request, such as a string or object.
154154
* @example
155155
* const res = await fetch(url, { body: JSON.stringify({ name: 'Alice' }) });
156156
*/
157-
body?: any
157+
body?: any;
158158

159159
/**
160160
* Request headers.
@@ -170,8 +170,8 @@ export interface FetchOptions {
170170
* @default 5
171171
* @example
172172
* const res = await fetch(url, { maxRedirects: 1 });
173-
**/
174-
maxRedirects?: number
173+
*/
174+
maxRedirects?: number;
175175

176176
/**
177177
* Maximum time to wait for the request to complete. Default
@@ -184,7 +184,7 @@ export interface FetchOptions {
184184
* // Timeout as milliseconds
185185
* const res = await fetch(url, { timeout: 3000 });
186186
*/
187-
timeout?: number | string
187+
timeout?: number | string;
188188
}
189189

190190
/**
@@ -209,4 +209,4 @@ export interface Response {
209209
* res.json()
210210
*/
211211
json(): JSONValue;
212-
}
212+
}

types/mokapi/index.d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export interface HttpRequest {
133133
/**
134134
* Request method.
135135
* @example GET
136-
* */
136+
*/
137137
readonly method: string;
138138

139139
/** Represents a parsed URL. */
@@ -543,15 +543,15 @@ export interface SharedMemory {
543543
* @param key The key to retrieve.
544544
* @returns The stored value, or `undefined` if not found.
545545
*/
546-
get(key: string): any
546+
get(key: string): any;
547547

548548
/**
549549
* Sets a value for the given key.
550550
* If the key already exists, its value will be replaced.
551551
* @param key The key to store the value under.
552552
* @param value The value to store.
553553
*/
554-
set(key: string, value: any): void
554+
set(key: string, value: any): void;
555555

556556
/**
557557
* Updates a value atomically using an updater function.
@@ -567,32 +567,32 @@ export interface SharedMemory {
567567
* @param updater Function that receives the current value and returns the new value.
568568
* @returns The new value after update.
569569
*/
570-
update<T = any>(key: string, updater: (value: T | undefined) => T): T
570+
update<T = any>(key: string, updater: (value: T | undefined) => T): T;
571571

572572
/**
573573
* Checks if the given key exists in shared memory.
574574
* @param key The key to check.
575575
* @returns `true` if the key exists, otherwise `false`.
576576
*/
577-
has(key: string): boolean
577+
has(key: string): boolean;
578578

579579
/**
580580
* Removes the specified key and its value from shared memory.
581581
* @param key The key to remove.
582582
*/
583-
delete(key: string): void
583+
delete(key: string): void;
584584

585585
/**
586586
* Removes all stored entries from shared memory.
587587
* Use with caution — this clears all shared state.
588588
*/
589-
clear(): void
589+
clear(): void;
590590

591591
/**
592592
* Returns a list of all stored keys.
593593
* @returns An array of key names.
594594
*/
595-
keys(): string[]
595+
keys(): string[];
596596

597597
/**
598598
* Creates or returns a namespaced shared memory store.
@@ -607,7 +607,7 @@ export interface SharedMemory {
607607
* @param name The namespace identifier.
608608
* @returns A `SharedMemory` object scoped to the given namespace.
609609
*/
610-
namespace(name: string): SharedMemory
610+
namespace(name: string): SharedMemory;
611611
}
612612

613613
/**
@@ -631,4 +631,4 @@ export interface SharedMemory {
631631
* mokapi.log(`Current counter: ${count}`)
632632
* ```
633633
*/
634-
export const shared: SharedMemory
634+
export const shared: SharedMemory;

types/mokapi/kafka.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,4 @@ export interface ProduceRetry {
243243
* @default 5
244244
*/
245245
retries: number;
246-
}
246+
}

types/mokapi/mail.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ export interface Attachment {
7878

7979
/** File data as binary content */
8080
data: Uint8Array;
81-
}
81+
}

types/mokapi/mustache.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ export interface ScopeObject {
3131
[key: string]: Scope | ScopeFunction;
3232
}
3333

34-
export type ScopeFunction = () => Scope;
34+
export type ScopeFunction = () => Scope;

types/mokapi/test/http-test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { del, get, head, options, patch, post, put, fetch } from "mokapi/http";
1+
import { del, fetch, get, head, options, patch, post, put } from "mokapi/http";
22

33
// @ts-expect-error
44
get();
@@ -104,4 +104,4 @@ fetch("http://foo.bar", { headers: { "Accept": "application/json" } });
104104
fetch("http://foo.bar", { body: { foo: "bar" } });
105105
fetch("http://foo.bar", { maxRedirects: 1 });
106106
fetch("http://foo.bar", { timeout: 3000 });
107-
fetch("http://foo.bar", { timeout: "3s" });
107+
fetch("http://foo.bar", { timeout: "3s" });

types/mokapi/test/mokapi-tests.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import {
1414
LdapSearchResponse,
1515
on,
1616
patch,
17+
shared,
1718
sleep,
1819
SmtpEventHandler,
1920
SmtpEventMessage,
20-
shared
2121
} from "mokapi";
2222

2323
const handler = () => {};
@@ -47,7 +47,9 @@ on("http", handler, {});
4747
on("http", handler, { tags: { foo: "bar" } });
4848
on("http", handler, { track: true });
4949
on("http", async () => {});
50-
on("http", (request) => { request.querystring });
50+
on("http", (request) => {
51+
request.querystring;
52+
});
5153

5254
// @ts-expect-error
5355
every(12, () => {});
@@ -318,6 +320,6 @@ let s: string | undefined = shared.get("foo");
318320
let n: number | undefined = shared.get("foo");
319321
let b: boolean = shared.has("foo");
320322
let keys: string[] = shared.keys();
321-
shared.namespace("foo").set("bar", 123)
323+
shared.namespace("foo").set("bar", 123);
322324
shared.update("foo", (v) => v ?? "new value");
323325
shared.clear();

types/mokapi/yaml.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ export function parse(text: string): any;
3535
* })
3636
* }
3737
*/
38-
export function stringify(value: JSONValue): string;
38+
export function stringify(value: JSONValue): string;

0 commit comments

Comments
 (0)