Skip to content

Commit

Permalink
type stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte committed Jul 25, 2024
1 parent 2c22879 commit 6bb0057
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 13 deletions.
2 changes: 2 additions & 0 deletions sites/docs/src/lib/content/api-reference/accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import StringOrArrayString from "./extended-types/string-or-array-string.md";
import SingleOrMultiple from "./extended-types/single-or-multiple.md";
import StringOrArrayChangeFn from "./extended-types/string-or-array-change-fn.md";
import Orientation from "./extended-types/orientation.md";
import HeaderLevel from "./extended-types/header-level.md";

const root = createApiSchema<AccordionRootPropsWithoutHTML>({
title: "Root",
Expand Down Expand Up @@ -108,6 +109,7 @@ const header = createApiSchema<AccordionHeaderPropsWithoutHTML>({
props: {
level: createUnionProp({
options: ["1", "2", "3", "4", "5", "6"],
definition: HeaderLevel,
description:
"The heading level of the header. This will be set as the `aria-level` attribute.",
default: "3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```ts
type ChildSnippetProps = {
{
props: Record<string, unknown>
}
```
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
```ts
import type { DateValue } from "@internationalized/date";

type DateMatcher = (date: DateValue) => boolean;
(date: DateValue) => boolean
```
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
```ts
import type { DateValue } from "@internationalized/date";

type OnPlaceholderChange = (date: DateValue) => void
(date: DateValue) => void
```
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
```ts
import type { DateValue } from "@internationalized/date";

// if `type` is `'single'`
type OnValueChange = (date: DateValue | undefined) => void
(date: DateValue | undefined) => void

// if `type` is `'multiple'`
type OnValueChange = (date: DateValue[]) => void
(date: DateValue[]) => void
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```ts
1 | 2 | 3 | 4 | 5 | 6
```
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
```ts
// if `type` is `'single'`
type OnChangeFn = (value: string) => void;
(value: string) => void

// if `type` is `'multiple'`
type OnChangeFn = (value: string[]) => void;
(value: string[]) => void
```

0 comments on commit 6bb0057

Please sign in to comment.