tldraw/apps/docs/components
alex f9ed1bf2c9
Force interface instead of type for better docs (#3815)
Typescript's type aliases (`type X = thing`) can refer to basically
anything, which makes it hard to write an automatic document formatter
for them. Interfaces on the other hand are only object, so they play
much nicer with docs. Currently, object-flavoured type aliases don't
really get expanded at all on our docs site, which means we have a bunch
of docs content that's not shown on the site.

This diff introduces a lint rule that forces `interface X {foo: bar}`s
instead of `type X = {foo: bar}` where possible, as it results in a much
better documentation experience:

Before:
<img width="437" alt="Screenshot 2024-05-22 at 15 24 13"
src="https://github.com/tldraw/tldraw/assets/1489520/32606fd1-6832-4a1e-aa5f-f0534d160c92">

After:
<img width="431" alt="Screenshot 2024-05-22 at 15 33 01"
src="https://github.com/tldraw/tldraw/assets/1489520/4e0d59ee-c38e-4056-b9fd-6a7f15d28f0f">


### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `docs` — Changes to the documentation, examples, or templates.
- [x] `improvement` — Improving existing features
2024-05-22 15:55:49 +00:00
..
article-components Add docs (#2470) 2024-01-15 12:33:15 +00:00
mdx-components [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
ArticleDetails.tsx Force interface instead of type for better docs (#3815) 2024-05-22 15:55:49 +00:00
ArticleDocsPage.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
ArticleHeadingLinks.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
ArticleNavLinks.tsx Force interface instead of type for better docs (#3815) 2024-05-22 15:55:49 +00:00
ArticleReferenceDocsPage.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
Autocomplete.css [docs] Small style changes (#2805) 2024-02-13 10:07:29 +00:00
Autocomplete.tsx Force interface instead of type for better docs (#3815) 2024-05-22 15:55:49 +00:00
AutoRefresh.tsx children: any -> children: ReactNode (#3061) 2024-03-04 14:48:40 +00:00
Breadcrumb.tsx Add docs (#2470) 2024-01-15 12:33:15 +00:00
CategoryDocsPage.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
ExampleCodeBlock.tsx tldraw_final_v6_final(old version).docx.pdf (#2998) 2024-02-29 16:06:19 +00:00
ExampleDocsPage.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
FancyBox.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
Footer.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
Header.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
HeroImage.tsx Add docs (#2470) 2024-01-15 12:33:15 +00:00
Icon.tsx Add docs (#2470) 2024-01-15 12:33:15 +00:00
Icons.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
Mdx.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
Search.tsx fix docs build (#3201) 2024-03-18 15:59:29 +00:00
SectionDocsPage.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
Sidebar.tsx [docs] design shuffle (#2951) 2024-02-29 16:28:45 +00:00
SidebarCloseButton.tsx Add docs (#2470) 2024-01-15 12:33:15 +00:00
Spinner.tsx [docs] Autocomplete styling tweaks (#2732) 2024-02-05 20:46:07 +00:00
ThemeSwitcher.tsx Add docs (#2470) 2024-01-15 12:33:15 +00:00
ToggleMenuButton.tsx Add docs (#2470) 2024-01-15 12:33:15 +00:00