-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathllms-full.txt
More file actions
138 lines (104 loc) · 5.22 KB
/
llms-full.txt
File metadata and controls
138 lines (104 loc) · 5.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# @lglab/react-qr-code Technical Reference
> Comprehensive technical documentation for @lglab/react-qr-code, a highly customizable React QR code generator.
This file provides all technical details including component props, types, and API references to enable LLMs to work with the library without fetching additional context.
## ReactQRCode Component
The main component exported by the library.
### Props (ReactQRCodeProps)
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `string \| string[]` | - | **Required.** The value to encode. Use an array for multi-segment optimization. |
| `size` | `number` | `128` | The size in pixels of the rendered QR code. |
| `level` | `'L' \| 'M' \| 'Q' \| 'H'` | `'L'` | Error Correction Level. |
| `marginSize` | `number` | `0` | Number of modules to use for the margin. |
| `minVersion` | `number` | `1` | Minimum version (1-40) for the QR code. |
| `boostLevel` | `boolean` | `true` | Boosts ECL if version remains the same. |
| `background` | `BackgroundSettings` | `'#FFFFFF'` | Background color (hex) or `GradientSettings`. |
| `gradient` | `GradientSettings` | - | Gradient applied to data modules and finder patterns. |
| `dataModulesSettings` | `DataModulesSettings` | - | Configuration for data modules styling. |
| `finderPatternOuterSettings` | `FinderPatternOuterSettings` | - | Configuration for outer finder patterns. |
| `finderPatternInnerSettings` | `FinderPatternInnerSettings` | - | Configuration for inner finder patterns. |
| `imageSettings` | `ImageSettings` | - | Settings for an embedded logo or image. |
| `svgProps` | `React.SVGProps<SVGSVGElement>` | - | Additional props passed to the root SVG element. |
---
## Sub-Settings Interfaces
### DataModulesSettings
| Property | Type | Default | Description |
| --- | --- | --- | --- |
| `color` | `string` | - | Color of the data modules (overridden by `gradient`). |
| `style` | `DataModulesStyle` | `'square'` | Shape of the data modules. |
| `randomSize` | `boolean` | `false` | If true, modules will have slightly varied sizes. |
**Available Styles (`DataModulesStyle`):**
`'square'`, `'square-sm'`, `'pinched-square'`, `'rounded'`, `'leaf'`, `'vertical-line'`, `'horizontal-line'`, `'circle'`, `'diamond'`, `'star'`, `'heart'`, `'hashtag'`
### FinderPatternOuterSettings
| Property | Type | Default | Description |
| --- | --- | --- | --- |
| `color` | `string` | - | Color of the outer pattern (overridden by `gradient`). |
| `style` | `FinderPatternOuterStyle` | `'square'` | Shape of the outer finder pattern. |
**Available Styles (`FinderPatternOuterStyle`):**
`'square'`, `'pinched-square'`, `'rounded-sm'`, `'rounded'`, `'rounded-lg'`, `'circle'`, `'inpoint-sm'`, `'inpoint'`, `'inpoint-lg'`, `'outpoint-sm'`, `'outpoint'`, `'outpoint-lg'`, `'leaf-sm'`, `'leaf'`, `'leaf-lg'`
### FinderPatternInnerSettings
| Property | Type | Default | Description |
| --- | --- | --- | --- |
| `color` | `string` | - | Color of the inner pattern (overridden by `gradient`). |
| `style` | `FinderPatternInnerStyle` | `'square'` | Shape of the inner finder pattern. |
**Available Styles (`FinderPatternInnerStyle`):**
Includes all `FinderPatternOuterStyle` plus: `'diamond'`, `'star'`, `'heart'`, `'hashtag'`
### ImageSettings
| Property | Type | Default | Description |
| --- | --- | --- | --- |
| `src` | `string` | - | **Required.** URL/Source of the image. |
| `height` | `number` | - | **Required.** Height in pixels. |
| `width` | `number` | - | **Required.** Width in pixels. |
| `excavate` | `boolean` | `false` | Remove modules behind the image. |
| `x` | `number` | - | Horizontal offset (centered by default). |
| `y` | `number` | - | Vertical offset (centered by default). |
| `opacity` | `number` | `1` | Image opacity (0-1). |
| `crossOrigin` | `CrossOrigin` | - | CORS setting for the image. |
### GradientSettings
| Property | Type | Default | Description |
| --- | --- | --- | --- |
| `type` | `'linear' \| 'radial'` | - | **Required.** Type of gradient. |
| `stops` | `GradientSettingsStop[]` | - | **Required.** Array of `{ offset: string, color: string }`. |
| `rotation` | `number` | `0` | Rotation in degrees (for linear gradients). |
---
## Imperative API (Ref)
The component exposes the following via `forwardRef`:
### ReactQRCodeRef
| Method / Property | Type | Description |
| --- | --- | --- |
| `svg` | `SVGSVGElement \| null` | Reference to the underlying SVG element. |
| `download` | `(options: DownloadOptions) => void` | Triggers a download of the QR code. |
### DownloadOptions
| Property | Type | Default | Description |
| --- | --- | --- | --- |
| `name` | `string` | `'qr-code'` | Filename without extension. |
| `format` | `'svg' \| 'png' \| 'jpeg'` | `'svg'` | Target file format. |
| `size` | `number` | `500` | Target size in pixels for the export. |
---
## Examples
### Basic Usage
```tsx
import { ReactQRCode } from '@lglab/react-qr-code';
<ReactQRCode value="https://reactqrcode.com" />
```
### Advanced Customization
```tsx
<ReactQRCode
value="https://reactqrcode.com"
size={256}
level="H"
dataModulesSettings={{
style: 'rounded',
color: '#2563eb'
}}
finderPatternOuterSettings={{
style: 'rounded-lg'
}}
imageSettings={{
src: '/logo.png',
width: 40,
height: 40,
excavate: true
}}
/>
```