Skip to content

Commit aeecbbe

Browse files
committed
chore: wip
1 parent 04f2282 commit aeecbbe

File tree

2 files changed

+48
-9
lines changed

2 files changed

+48
-9
lines changed

.stacks/core/types/src/dns.ts

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
interface ARecord {
2+
name: string | '@' | '*'
3+
address: string // IPv4
4+
ttl?: number | 'auto'
5+
}
6+
7+
interface CNameRecord {
8+
name: string
9+
target: string
10+
ttl: number | 'auto'
11+
}
12+
13+
interface MXRecord {
14+
name: string | '@'
15+
mailServer: string
16+
ttl: number | 'auto'
17+
priority: number // 0-65535
18+
}
19+
20+
interface TxtRecord {
21+
name: string | '@'
22+
ttl: number | 'auto'
23+
content: string
24+
}
25+
26+
interface AAAARecord {
27+
name: string | '@' | '*'
28+
address: string // IPv6
29+
ttl: number | 'auto'
30+
}
31+
32+
export type DnsRecord = ARecord | CNameRecord | MXRecord | TxtRecord | AAAARecord
33+
134
export interface DnsOptions {
235
/**
336
* **DNS Options**
@@ -9,10 +42,10 @@ export interface DnsOptions {
942
* @default {}
1043
* @see https://stacksjs.dev/docs/dns
1144
*/
12-
a?: []
13-
aaaa?: []
14-
cname?: []
15-
mx?: []
45+
a?: ARecord[]
46+
aaaa?: AAAARecord[]
47+
cname?: CNameRecord[]
48+
mx?: MXRecord[]
49+
txt?: TxtRecord[]
1650
ns?: []
17-
txt?: []
1851
}

config/dns.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@ import { defineDnsConfig } from 'stacks/core/config/src'
33
/**
44
* **DNS Options**
55
*
6-
* This configuration defines all of your DNS options. Because Stacks is fully-typed,
7-
* you may hover any of the options below and the definitions will be provided. In case
8-
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
6+
* This configuration defines all of your DNS options. Because Stacks is fully-typed, you
7+
* may hover any of the options below and the definitions will be provided. In case you
8+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
99
*/
1010
export default defineDnsConfig({
11-
a: [],
11+
a: [
12+
{
13+
name: '',
14+
address: '',
15+
ttl: 300,
16+
},
17+
],
1218
aaaa: [],
1319
cname: [],
1420
txt: [],

0 commit comments

Comments
 (0)