@scrawn/core 0.0.3 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/config.d.ts +41 -0
  2. package/dist/config.d.ts.map +1 -0
  3. package/dist/config.js +32 -0
  4. package/dist/config.js.map +1 -0
  5. package/dist/core/auth/apiKeyAuth.d.ts +58 -0
  6. package/dist/core/auth/apiKeyAuth.d.ts.map +1 -0
  7. package/dist/core/auth/apiKeyAuth.js +66 -0
  8. package/dist/core/auth/apiKeyAuth.js.map +1 -0
  9. package/dist/core/auth/baseAuth.d.ts +70 -0
  10. package/dist/core/auth/baseAuth.d.ts.map +1 -0
  11. package/dist/core/auth/baseAuth.js +22 -0
  12. package/dist/core/auth/baseAuth.js.map +1 -0
  13. package/dist/core/errors/index.d.ts +192 -0
  14. package/dist/core/errors/index.d.ts.map +1 -0
  15. package/dist/core/errors/index.js +280 -0
  16. package/dist/core/errors/index.js.map +1 -0
  17. package/dist/core/grpc/callContext.d.ts +18 -0
  18. package/dist/core/grpc/callContext.d.ts.map +1 -0
  19. package/dist/core/grpc/callContext.js +35 -0
  20. package/dist/core/grpc/callContext.js.map +1 -0
  21. package/dist/core/grpc/client.d.ts +16 -0
  22. package/dist/core/grpc/client.d.ts.map +1 -0
  23. package/dist/core/grpc/client.js +30 -0
  24. package/dist/core/grpc/client.js.map +1 -0
  25. package/dist/core/grpc/index.d.ts +14 -0
  26. package/dist/core/grpc/index.d.ts.map +1 -0
  27. package/dist/core/grpc/index.js +13 -0
  28. package/dist/core/grpc/index.js.map +1 -0
  29. package/dist/core/grpc/requestBuilder.d.ts +15 -0
  30. package/dist/core/grpc/requestBuilder.d.ts.map +1 -0
  31. package/dist/core/grpc/requestBuilder.js +56 -0
  32. package/dist/core/grpc/requestBuilder.js.map +1 -0
  33. package/dist/core/grpc/streamRequestBuilder.d.ts +13 -0
  34. package/dist/core/grpc/streamRequestBuilder.d.ts.map +1 -0
  35. package/dist/core/grpc/streamRequestBuilder.js +60 -0
  36. package/dist/core/grpc/streamRequestBuilder.js.map +1 -0
  37. package/dist/core/grpc/types.d.ts +7 -0
  38. package/dist/core/grpc/types.d.ts.map +1 -0
  39. package/dist/core/grpc/types.js +2 -0
  40. package/dist/core/grpc/types.js.map +1 -0
  41. package/dist/core/pricing/builders.d.ts +157 -0
  42. package/dist/core/pricing/builders.d.ts.map +1 -0
  43. package/dist/core/pricing/builders.js +218 -0
  44. package/dist/core/pricing/builders.js.map +1 -0
  45. package/dist/core/pricing/index.d.ts +30 -0
  46. package/dist/core/pricing/index.d.ts.map +1 -0
  47. package/dist/core/pricing/index.js +32 -0
  48. package/dist/core/pricing/index.js.map +1 -0
  49. package/dist/core/pricing/resolve.d.ts +39 -0
  50. package/dist/core/pricing/resolve.d.ts.map +1 -0
  51. package/dist/core/pricing/resolve.js +50 -0
  52. package/dist/core/pricing/resolve.js.map +1 -0
  53. package/dist/core/pricing/serialize.d.ts +55 -0
  54. package/dist/core/pricing/serialize.d.ts.map +1 -0
  55. package/dist/core/pricing/serialize.js +127 -0
  56. package/dist/core/pricing/serialize.js.map +1 -0
  57. package/dist/core/pricing/types.d.ts +122 -0
  58. package/dist/core/pricing/types.d.ts.map +1 -0
  59. package/dist/core/pricing/types.js +17 -0
  60. package/dist/core/pricing/types.js.map +1 -0
  61. package/dist/core/pricing/validate.d.ts +56 -0
  62. package/dist/core/pricing/validate.d.ts.map +1 -0
  63. package/dist/core/pricing/validate.js +162 -0
  64. package/dist/core/pricing/validate.js.map +1 -0
  65. package/dist/core/scrawn.d.ts +398 -0
  66. package/dist/core/scrawn.d.ts.map +1 -0
  67. package/dist/core/scrawn.js +729 -0
  68. package/dist/core/scrawn.js.map +1 -0
  69. package/dist/core/types/auth.d.ts +31 -0
  70. package/dist/core/types/auth.d.ts.map +1 -0
  71. package/dist/core/types/auth.js +2 -0
  72. package/dist/core/types/auth.js.map +1 -0
  73. package/dist/core/types/event.d.ts +283 -0
  74. package/dist/core/types/event.d.ts.map +1 -0
  75. package/dist/core/types/event.js +143 -0
  76. package/dist/core/types/event.js.map +1 -0
  77. package/dist/gen/auth/v1/auth_grpc_pb.d.ts +3 -0
  78. package/dist/gen/auth/v1/auth_pb.d.ts +65 -0
  79. package/dist/gen/data/v1/data_grpc_pb.d.ts +5 -0
  80. package/dist/gen/data/v1/data_pb.d.ts +254 -0
  81. package/dist/gen/event/v1/event_grpc_pb.d.ts +3 -0
  82. package/dist/gen/event/v1/event_pb.d.ts +278 -0
  83. package/dist/gen/payment/v1/payment_grpc_pb.d.ts +3 -0
  84. package/dist/gen/payment/v1/payment_pb.d.ts +45 -0
  85. package/dist/gen/query/v1/query_grpc_pb.d.ts +5 -0
  86. package/dist/gen/query/v1/query_pb.d.ts +359 -0
  87. package/dist/index.d.ts +20 -0
  88. package/dist/index.d.ts.map +1 -0
  89. package/dist/index.js +25 -0
  90. package/dist/index.js.map +1 -0
  91. package/dist/utils/forkAsyncIterable.d.ts +13 -0
  92. package/dist/utils/forkAsyncIterable.d.ts.map +1 -0
  93. package/dist/utils/forkAsyncIterable.js +78 -0
  94. package/dist/utils/forkAsyncIterable.js.map +1 -0
  95. package/dist/utils/logger.d.ts +10 -0
  96. package/dist/utils/logger.d.ts.map +1 -0
  97. package/dist/utils/logger.js +62 -0
  98. package/dist/utils/logger.js.map +1 -0
  99. package/dist/utils/pathMatcher.d.ts +25 -0
  100. package/dist/utils/pathMatcher.d.ts.map +1 -0
  101. package/dist/utils/pathMatcher.js +46 -0
  102. package/dist/utils/pathMatcher.js.map +1 -0
  103. package/package.json +2 -2
@@ -0,0 +1,398 @@
1
+ import type { EventPayload, MiddlewareRequest, MiddlewareResponse, MiddlewareNext, MiddlewareEventConfig, AITokenUsagePayload, EventConsumerErrorCallback } from "./types/event.js";
2
+ import type { AllCredentials } from "./types/auth.js";
3
+ import type { TagExpr, PriceExpr, ScrawnExpr } from "./pricing/types.js";
4
+ import { GrpcClient } from "./grpc/index.js";
5
+ import type { StreamEventResponse } from "../gen/event/v1/event_pb.js";
6
+ /**
7
+ * Main SDK class for Scrawn billing infrastructure.
8
+ *
9
+ * Manages authentication, event tracking, and credential caching.
10
+ * All event consumption methods are available directly on the SDK instance.
11
+ *
12
+ * @typeParam TTags - Union of valid tag names for compile-time type checking
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * import { createScrawn } from '@scrawn/core';
17
+ *
18
+ * const biller = createScrawn({
19
+ * apiKey: process.env.SCRAWN_KEY,
20
+ * baseURL: 'http://localhost:8069',
21
+ * tags: ["PREMIUM_CALL", "EXTRA_FEE"] as const,
22
+ * });
23
+ *
24
+ * // Tags are compile-time checked
25
+ * biller.sdkCallEventConsumer({ userId: 'u123', debitTag: 'PREMIUM_FEATURE' });
26
+ * // biller.sdkCallEventConsumer({ userId: 'u123', debitTag: 'UNKNOWN' }); // Type error!
27
+ * ```
28
+ */
29
+ export declare class Scrawn<TTags extends string = string, TExprs extends string = string> {
30
+ /** Map of authentication method names to their implementations */
31
+ private authMethods;
32
+ /**
33
+ * Cache of credentials keyed by auth method name for performance.
34
+ * Keys are restricted to registered auth method names only.
35
+ */
36
+ private credCache;
37
+ /** API key used for default authentication */
38
+ private apiKey;
39
+ /** gRPC client for making type-safe API calls */
40
+ private grpcClient;
41
+ /** Public access to the gRPC client for use by other packages (e.g. @scrawn/analytics) */
42
+ get grpc(): GrpcClient;
43
+ /** API key used for authorizing gRPC calls */
44
+ get apikey(): string;
45
+ private notifyEventConsumerError;
46
+ private notifyValidationError;
47
+ /**
48
+ * Creates a new Scrawn SDK instance.
49
+ *
50
+ * @param config - Configuration object
51
+ * @param config.apiKey - Your Scrawn API key for authentication
52
+ * @param config.baseURL - Base URL for the Scrawn API (e.g., 'https://api.scrawn.dev')
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * const scrawn = new Scrawn({
57
+ * apiKey: 'sk_test_...',
58
+ * baseURL: 'https://api.scrawn.dev'
59
+ * });
60
+ * await scrawn.init();
61
+ * ```
62
+ */
63
+ constructor(config: {
64
+ apiKey: AllCredentials["apiKey"];
65
+ baseURL: string;
66
+ secure?: boolean;
67
+ credentials?: import("@grpc/grpc-js").ChannelCredentials;
68
+ });
69
+ private parseURLToTarget;
70
+ /**
71
+ * Create a type-safe tag reference.
72
+ *
73
+ * Only tag names known to this biller instance are accepted at compile time.
74
+ * Tag values are resolved to cent amounts by the backend at runtime.
75
+ *
76
+ * @param name - The tag name (must be one of the known tags for this instance)
77
+ * @returns A TagExpr referencing the named tag
78
+ * @throws PricingExpressionError at runtime if name format is invalid
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * const expr = mul(biller.tag("PREMIUM_CALL"), 3);
83
+ * ```
84
+ */
85
+ tag<T extends TTags>(name: T): TagExpr<T>;
86
+ /**
87
+ * Create a type-safe reference to a persisted expression.
88
+ *
89
+ * Expression names are compile-time checked against known expressions
90
+ * synced from the Scrawn server. The backend resolves the stored
91
+ * expression string and evaluates it at runtime.
92
+ *
93
+ * Also accepts inline PriceExpr as a passthrough for a consistent
94
+ * `biller.expr()` entry point for all expressions.
95
+ *
96
+ * @param nameOrExpr - The persisted expression name or an inline PriceExpr
97
+ * @returns An ExprRef (if name) or the original PriceExpr (passthrough)
98
+ *
99
+ * @example
100
+ * ```typescript
101
+ * // Reference a persisted expression
102
+ * biller.sdkCallEventConsumer({
103
+ * userId: 'u123',
104
+ * debitExpr: biller.expr("MY_EXPR"),
105
+ * });
106
+ *
107
+ * // Inline expression passthrough
108
+ * biller.sdkCallEventConsumer({
109
+ * userId: 'u123',
110
+ * debitExpr: biller.expr(mul(biller.tag("PREMIUM_CALL"), 3)),
111
+ * });
112
+ * ```
113
+ */
114
+ expr<T extends TExprs>(name: T): ScrawnExpr<TTags>;
115
+ expr(expr: PriceExpr<TTags>): ScrawnExpr<TTags>;
116
+ /**
117
+ * Register an authentication method with the SDK.
118
+ *
119
+ * Auth methods handle credential management and can be shared across multiple event types.
120
+ * Only auth method names defined in AuthRegistry are allowed.
121
+ *
122
+ * @param name - Unique identifier for this auth method (must be in AuthRegistry)
123
+ * @param auth - Instance of an AuthBase implementation
124
+ *
125
+ * @example
126
+ * ```typescript
127
+ * scrawn.registerAuthMethod('api', new ApiKeyAuth('sk_test_...'));
128
+ * ```
129
+ */
130
+ private registerAuthMethod;
131
+ /**
132
+ * Get credentials for a specific authentication method.
133
+ *
134
+ * Credentials are cached after the first fetch for performance.
135
+ * Subsequent calls return the cached value without re-fetching.
136
+ * Only auth method names defined in AuthRegistry are allowed.
137
+ *
138
+ * @param authMethodName - Name of the auth method to get credentials for (must be in AuthRegistry)
139
+ * @returns A promise that resolves to the credentials object
140
+ * @throws Error if the auth method is not registered
141
+ *
142
+ * @example
143
+ * ```typescript
144
+ * const creds = await scrawn.getCredsFor('api');
145
+ * // { apiKey: 'sk_test_...' }
146
+ * ```
147
+ */
148
+ private getCredsFor;
149
+ /**
150
+ * Track an SDK call event.
151
+ *
152
+ * Records SDK usage to the Scrawn backend for billing tracking.
153
+ * The event is authenticated using the API key provided during SDK initialization.
154
+ *
155
+ * @param payload - The SDK call data to track
156
+ * @param payload.userId - Unique identifier of the user making the call
157
+ * @param payload.debitAmount - (Optional) Direct amount in cents to debit from the user's account
158
+ * @param payload.debitTag - (Optional) Named price tag for backend-managed pricing
159
+ * @param payload.debitExpr - (Optional) Pricing expression for complex calculations
160
+ * @param options - Optional configuration
161
+ * @param options.onError - Optional callback for handling validation or gRPC errors
162
+ * @returns A promise that resolves when the event is tracked or returns early on error
163
+ *
164
+ * @example
165
+ * ```typescript
166
+ * import { add, mul, tag } from '@scrawn/core';
167
+ *
168
+ * // Using direct amount (500 cents = $5.00)
169
+ * await scrawn.sdkCallEventConsumer({
170
+ * userId: 'user_abc123',
171
+ * debitAmount: 500
172
+ * });
173
+ *
174
+ * // Using price tag
175
+ * await scrawn.sdkCallEventConsumer({
176
+ * userId: 'user_abc123',
177
+ * debitTag: 'PREMIUM_FEATURE'
178
+ * });
179
+ *
180
+ * // Using pricing expression: (PREMIUM_CALL * 3) + EXTRA_FEE + 250 cents
181
+ * await scrawn.sdkCallEventConsumer({
182
+ * userId: 'user_abc123',
183
+ * debitExpr: add(mul(tag('PREMIUM_CALL'), 3), tag('EXTRA_FEE'), 250)
184
+ * });
185
+ * ```
186
+ */
187
+ sdkCallEventConsumer(payload: EventPayload<TTags>, options?: {
188
+ onError?: EventConsumerErrorCallback;
189
+ }): Promise<void>;
190
+ /**
191
+ * Create an Express-compatible middleware for tracking API endpoint usage.
192
+ *
193
+ * This middleware automatically tracks requests to your API endpoints for billing purposes.
194
+ * You provide an extractor function that determines the userId and debit info (amount or tag) from each request.
195
+ * Optionally, you can provide a whitelist array to only track specific endpoints,
196
+ * or a blacklist array to exclude specific endpoints from tracking.
197
+ *
198
+ * The middleware is framework-agnostic and works with Express, Fastify, and similar frameworks.
199
+ *
200
+ * @param config - Configuration object for the middleware
201
+ * @param config.extractor - Function that extracts userId and debitAmount from the request. Return null to skip tracking.
202
+ * @param config.whitelist - Optional array of endpoint patterns to track. Supports wildcards:
203
+ * - Exact match: /api/users
204
+ * - Single segment (*): /api/* matches /api/users but not /api/users/123
205
+ * - Multi-segment (**): /api/** matches any path starting with /api/
206
+ * - Mixed: /api/star/profile, **.php
207
+ * Takes precedence over blacklist. If omitted, all requests will be tracked.
208
+ * @param config.blacklist - Optional array of endpoint patterns to exclude. Same wildcard support as whitelist.
209
+ * Only applies to endpoints not in the whitelist.
210
+ * @param config.onError - Optional callback for handling validation or gRPC errors
211
+ *
212
+ * @returns Express-compatible middleware function
213
+ *
214
+ * @example
215
+ * ```typescript
216
+ * // Track all endpoints
217
+ * app.use(scrawn.middlewareEventConsumer({
218
+ * extractor: (req) => ({
219
+ * userId: req.user.id,
220
+ * debitAmount: 1
221
+ * })
222
+ * }));
223
+ *
224
+ * // Track only specific endpoints with wildcards
225
+ * app.use(scrawn.middlewareEventConsumer({
226
+ * extractor: (req) => ({
227
+ * userId: req.headers['x-user-id'] as string,
228
+ * debitAmount: req.body.tokens || 1
229
+ * }),
230
+ * whitelist: ['/api/generate', '/api/analyze', '/api/v1/*']
231
+ * }));
232
+ *
233
+ * // Exclude specific endpoints from tracking
234
+ * app.use(scrawn.middlewareEventConsumer({
235
+ * extractor: (req) => ({
236
+ * userId: req.user.id,
237
+ * debitAmount: 1
238
+ * }),
239
+ * blacklist: ['/health', '/api/collect-payment', '/internal/**', '**.tmp']
240
+ * }));
241
+ * ```
242
+ */
243
+ middlewareEventConsumer(config: MiddlewareEventConfig<TTags>): (req: MiddlewareRequest, res: MiddlewareResponse, next: MiddlewareNext) => Promise<void>;
244
+ /**
245
+ * Collect payment by creating a checkout link for a user.
246
+ *
247
+ * Generates a payment checkout link for the specified user via the Scrawn payment service.
248
+ * The checkout link can be used to direct users to complete their payment.
249
+ *
250
+ * @param userId - Unique identifier of the user to collect payment from
251
+ * @returns A promise that resolves to the checkout link URL
252
+ * @throws Error if the gRPC call fails or if authentication is invalid
253
+ *
254
+ * @example
255
+ * ```typescript
256
+ * const checkoutLink = await scrawn.collectPayment('user_abc123');
257
+ * // Returns: 'https://checkout.scrawn.dev/...'
258
+ * // Redirect user to this URL to complete payment
259
+ * ```
260
+ */
261
+ collectPayment(userId: string): Promise<string>;
262
+ /**
263
+ * Internal method to consume and process an event.
264
+ *
265
+ * This method:
266
+ * 1. Validates authentication
267
+ * 2. Fetches/caches credentials
268
+ * 3. Executes any pre-run hooks
269
+ * 4. Processes the event via gRPC call to RegisterEvent
270
+ *
271
+ * @param payload - Event payload data
272
+ * @param authMethodName - Name of the auth method to use (must be in AuthRegistry)
273
+ * @param eventType - Type of event for categorization (RAW or MIDDLEWARE_CALL)
274
+ * @returns A promise that resolves when the event is processed
275
+ * @throws Error if auth method is not registered or gRPC call fails
276
+ *
277
+ * @internal
278
+ */
279
+ private consumeEvent;
280
+ /**
281
+ * Configuration options for aiTokenStreamConsumer.
282
+ */
283
+ /**
284
+ * Stream AI token usage events to the Scrawn backend (fire-and-forget mode).
285
+ *
286
+ * Consumes an async iterable of AI token usage payloads and streams them
287
+ * to the backend for billing tracking. This is designed for real-time
288
+ * AI token tracking where usage is reported as tokens are consumed.
289
+ *
290
+ * @param stream - An async iterable of AI token usage payloads
291
+ * @returns A promise that resolves to the stream response or undefined on error
292
+ */
293
+ aiTokenStreamConsumer(stream: AsyncIterable<AITokenUsagePayload<TTags>>): Promise<StreamEventResponse | undefined>;
294
+ /**
295
+ * Stream AI token usage events to the Scrawn backend (fire-and-forget mode).
296
+ *
297
+ * @param stream - An async iterable of AI token usage payloads
298
+ * @param config - Configuration with return: false (or omitted)
299
+ * @returns A promise that resolves to the stream response or undefined on error
300
+ */
301
+ aiTokenStreamConsumer(stream: AsyncIterable<AITokenUsagePayload<TTags>>, config: {
302
+ return?: false;
303
+ onError?: EventConsumerErrorCallback;
304
+ }): Promise<StreamEventResponse | undefined>;
305
+ /**
306
+ * Stream AI token usage events to the Scrawn backend while returning a forked stream.
307
+ *
308
+ * When `return: true`, the input stream is forked: one fork is sent to the billing
309
+ * backend (non-blocking), and the other fork is returned to the caller for streaming
310
+ * to the user. This enables simultaneous billing and user-facing token streaming.
311
+ *
312
+ * @param stream - An async iterable of AI token usage payloads
313
+ * @param config - Configuration with return: true
314
+ * @returns Object containing the response promise (or undefined on error) and a forked stream for user consumption
315
+ *
316
+ * @example
317
+ * ```typescript
318
+ * const { response, stream: userStream } = await scrawn.aiTokenStreamConsumer(
319
+ * tokenGenerator(),
320
+ * { return: true }
321
+ * );
322
+ *
323
+ * // Stream tokens to user while billing happens in background
324
+ * for await (const token of userStream) {
325
+ * process.stdout.write(token.outputTokens.toString());
326
+ * }
327
+ *
328
+ * // Billing completes after stream is consumed
329
+ * const result = await response;
330
+ * if (result) {
331
+ * console.log(`Billed ${result.getEventsprocessed()} events`);
332
+ * }
333
+ * ```
334
+ */
335
+ aiTokenStreamConsumer(stream: AsyncIterable<AITokenUsagePayload<TTags>>, config: {
336
+ return: true;
337
+ onError?: EventConsumerErrorCallback;
338
+ }): Promise<{
339
+ response: Promise<StreamEventResponse | undefined>;
340
+ stream: AsyncIterable<AITokenUsagePayload<TTags>>;
341
+ }>;
342
+ /**
343
+ * Transform user-provided AI token usage payloads into StreamEventRequest format.
344
+ *
345
+ * Validates each payload and maps it to the gRPC request format.
346
+ * Invalid payloads are logged and skipped.
347
+ *
348
+ * @param stream - The user's async iterable of AITokenUsagePayload
349
+ * @returns An async iterable of StreamEventRequest payloads
350
+ * @internal
351
+ */
352
+ private transformAITokenStream;
353
+ }
354
+ /**
355
+ * Configuration for creating a Scrawn instance via {@link createScrawn}.
356
+ */
357
+ export interface ScrawnInitConfig {
358
+ apiKey: string;
359
+ baseURL: string;
360
+ secure?: boolean;
361
+ credentials?: import("@grpc/grpc-js").ChannelCredentials;
362
+ tags?: readonly string[];
363
+ expressions?: readonly string[];
364
+ }
365
+ /**
366
+ * Create a type-safe Scrawn billing instance.
367
+ *
368
+ * When `tags` or `expressions` are provided as const arrays, the returned
369
+ * instance is parameterized with the union of those names. All pricing
370
+ * methods will be compile-time checked against the known set.
371
+ *
372
+ * @example
373
+ * ```typescript
374
+ * import { createScrawn, mul, inputTokens } from '@scrawn/core';
375
+ *
376
+ * const biller = createScrawn({
377
+ * apiKey: process.env.SCRAWN_KEY,
378
+ * baseURL: process.env.SCRAWN_BASE_URL,
379
+ * tags: ["PREMIUM_CALL", "EXTRA_FEE"] as const,
380
+ * expressions: ["MY_EXPR"] as const,
381
+ * });
382
+ *
383
+ * biller.sdkCallEventConsumer({
384
+ * userId: 'u123',
385
+ * debitExpr: biller.expr("MY_EXPR"), // persisted expression
386
+ * });
387
+ * biller.sdkCallEventConsumer({
388
+ * userId: 'u123',
389
+ * debitExpr: mul(biller.tag("PREMIUM_CALL"), 3), // inline
390
+ * });
391
+ * ```
392
+ */
393
+ export declare function createScrawn<const TTags extends readonly string[], const TExprs extends readonly string[]>(config: ScrawnInitConfig & {
394
+ tags: TTags;
395
+ expressions: TExprs;
396
+ }): Scrawn<TTags[number], TExprs[number]>;
397
+ export declare function createScrawn(config: ScrawnInitConfig): Scrawn;
398
+ //# sourceMappingURL=scrawn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scrawn.d.ts","sourceRoot":"","sources":["../../src/core/scrawn.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,0BAA0B,EAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAGV,cAAc,EACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,OAAO,EACP,SAAS,EAET,UAAU,EACX,MAAM,oBAAoB,CAAC;AAS5B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAU7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAiBvE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,MAAM,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,MAAM,SAAS,MAAM,GAAG,MAAM;IAC/E,kEAAkE;IAClE,OAAO,CAAC,WAAW,CAAuD;IAE1E;;;OAGG;IACH,OAAO,CAAC,SAAS,CAA6C;IAE9D,8CAA8C;IAC9C,OAAO,CAAC,MAAM,CAA2B;IAEzC,iDAAiD;IACjD,OAAO,CAAC,UAAU,CAAa;IAE/B,0FAA0F;IAC1F,IAAW,IAAI,IAAI,UAAU,CAE5B;IAED,8CAA8C;IAC9C,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED,OAAO,CAAC,wBAAwB;IAShC,OAAO,CAAC,qBAAqB;IAQ7B;;;;;;;;;;;;;;;OAeG;gBACS,MAAM,EAAE;QAClB,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;QACjC,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,WAAW,CAAC,EAAE,OAAO,eAAe,EAAE,kBAAkB,CAAC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