@qr-platform/qr-code.js 0.8.22 → 0.8.24

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/lib/node.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { QRCodeBuilder } from './builder/node';
2
1
  import { QRCodeJs as _QRCodeJs } from './core/qr-code-js';
3
2
  import { type ValidationResult } from './license/LicenseManagerNode';
4
3
  import type * as _browserUtils from './tools/browser-utils';
@@ -33,11 +32,27 @@ export declare class QRCodeJs extends _QRCodeJs {
33
32
  validateScanning(): Promise<ScanValidatorResponse>;
34
33
  /**
35
34
  * Creates a QRCodeBuilder instance initialized with a specific template.
36
- * Allows for fluent configuration chaining.
35
+ * Allows for fluent configuration chaining. We need it here to avoid circular dependency
37
36
  * @param templateName - The name of the template to start with.
38
37
  * @returns A new QRCodeBuilder instance.
39
38
  */
40
- static useTemplate(templateName: string): QRCodeBuilder;
39
+ static useTemplate(templateName: string): QRCodeBuilder<QRCodeJs>;
40
+ }
41
+ type QRCodeJsConstructor<T extends QRCodeJs = QRCodeJs> = new (options: Options) => T;
42
+ declare class QRCodeBuilder<T extends QRCodeJs> {
43
+ protected config: RecursivePartial<Options>;
44
+ protected qrCodeJsConstructor: QRCodeJsConstructor<T>;
45
+ /**
46
+ * Creates a new QRCodeBuilderCore instance.
47
+ * @param templateName - Optional name of a predefined template to start with.
48
+ */
49
+ constructor(templateName?: string);
50
+ /**
51
+ * Merges the provided options into the builder's configuration and creates the QRCodeJs instance.
52
+ * @param options - A partial options object to merge.
53
+ * @returns The created QRCodeJs instance.
54
+ */
55
+ options(options: RecursivePartial<Options>): T;
41
56
  }
42
57
  export declare class _ extends QRCodeJs {
43
58
  protected _hls(): boolean;