Skip to content

Commit a16bea2

Browse files
docs(ts): update TSDoc links to official documentation (#561)
1 parent ca134e7 commit a16bea2

File tree

13 files changed

+72
-66
lines changed

13 files changed

+72
-66
lines changed

packages/autocomplete-core/src/types/AutocompleteOptions.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ export interface AutocompleteOptions<TItem extends BaseItem> {
5151
*
5252
* This is useful while developing because it keeps the panel open even when the blur event occurs. **Make sure to disable it in production.**
5353
*
54-
* See [**Debugging**](https://autocomplete.algolia.com/docs/debugging) for more information.
54+
* See [**Debugging**](https://www.algolia.com/doc/ui-libraries/autocomplete/guides/debugging/) for more information.
5555
*
5656
* @default false
57-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#debug
57+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-debug
5858
*/
5959
debug?: boolean;
6060
/**
@@ -63,26 +63,26 @@ export interface AutocompleteOptions<TItem extends BaseItem> {
6363
* It is incremented by default when creating a new Autocomplete instance.
6464
*
6565
* @default "autocomplete-0"
66-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#id
66+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-id
6767
*/
6868
id?: string;
6969
/**
7070
* The function called when the internal state changes.
7171
*
72-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#onstatechange
72+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-onstatechange
7373
*/
7474
onStateChange?(props: OnStateChangeProps<TItem>): void;
7575
/**
7676
* The placeholder text to show in the search input when there's no query.
7777
*
78-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#placeholder
78+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-placeholder
7979
*/
8080
placeholder?: string;
8181
/**
8282
* Whether to focus the search input or not when the page is loaded.
8383
*
8484
* @default false
85-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#autofocus
85+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-autofocus
8686
*/
8787
autoFocus?: boolean;
8888
/**
@@ -91,33 +91,33 @@ export interface AutocompleteOptions<TItem extends BaseItem> {
9191
* We recommend using `0` when the autocomplete is used to open links, instead of triggering a search in an application.
9292
*
9393
* @default null
94-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#defaultactiveitemid
94+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-defaultactiveitemid
9595
*/
9696
defaultActiveItemId?: number | null;
9797
/**
9898
* Whether to open the panel on focus when there's no query.
9999
*
100100
* @default false
101-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#openonfocus
101+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-openonfocus
102102
*/
103103
openOnFocus?: boolean;
104104
/**
105-
* How many milliseconds must elapse before considering the autocomplete experience [stalled](https://autocomplete.algolia.com/docs/state#status).
105+
* How many milliseconds must elapse before considering the autocomplete experience [stalled](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state/#param-status).
106106
*
107107
* @default 300
108-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#stallthreshold
108+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-stallthreshold
109109
*/
110110
stallThreshold?: number;
111111
/**
112112
* The initial state to apply when autocomplete is created.
113113
*
114-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#initialstate
114+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-initialstate
115115
*/
116116
initialState?: Partial<AutocompleteState<TItem>>;
117117
/**
118-
* The [sources](https://autocomplete.algolia.com/docs/sources) to get the suggestions from.
118+
* The [sources](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/) to get the suggestions from.
119119
*
120-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#getsources
120+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-getsources
121121
*/
122122
getSources?: GetSources<TItem>;
123123
/**
@@ -126,43 +126,43 @@ export interface AutocompleteOptions<TItem extends BaseItem> {
126126
* This is useful if you're using autocomplete in a different context than `window`.
127127
*
128128
* @default window
129-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#environment
129+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-environment
130130
*/
131131
environment?: AutocompleteEnvironment;
132132
/**
133133
* An implementation of Autocomplete's Navigator API to redirect the user when opening a link.
134134
*
135-
* Learn more on the [**Navigator API**](https://autocomplete.algolia.com/docs/keyboard-navigation) documentation.
135+
* Learn more on the [**Navigator API**](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/keyboard-navigation/) documentation.
136136
*
137-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#navigator
137+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-navigator
138138
*/
139139
navigator?: Partial<AutocompleteNavigator<TItem>>;
140140
/**
141141
* The function called to determine whether the panel should open or not.
142142
*
143143
* By default, the panel opens when there are items in the state.
144144
*
145-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#shouldpanelopen
145+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-shouldpanelopen
146146
*/
147147
shouldPanelOpen?(params: { state: AutocompleteState<TItem> }): boolean;
148148
/**
149149
* The function called when submitting the Autocomplete form.
150150
*
151-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#onsubmit
151+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-onsubmit
152152
*/
153153
onSubmit?(params: OnSubmitParams<TItem>): void;
154154
/**
155155
* The function called when resetting the Autocomplete form.
156156
*
157-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#onreset
157+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-onreset
158158
*/
159159
onReset?(params: OnResetParams<TItem>): void;
160160
/**
161161
* The plugins that encapsulate and distribute custom Autocomplete behaviors.
162162
*
163-
* See [**Plugins**](https://autocomplete.algolia.com/docs/plugins) for more information.
163+
* See [**Plugins**](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/plugins/) for more information.
164164
*
165-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#plugins
165+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-plugins
166166
*/
167167
plugins?: Array<AutocompletePlugin<any, any>>;
168168
}

packages/autocomplete-core/src/types/AutocompletePlugin.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@ export type AutocompletePlugin<
2121
* The function called when Autocomplete starts.
2222
*
2323
* It lets you subscribe to lifecycle hooks and interact with the instance's state and context.
24+
*
25+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/plugins/#param-subscribe
2426
*/
2527
subscribe?(params: PluginSubscribeParams<any>): void;
2628
/**
2729
* An extra plugin object to expose properties and functions as APIs.
30+
*
31+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/plugins/#param-data
2832
*/
2933
data?: TData;
3034
};

packages/autocomplete-core/src/types/AutocompleteSetters.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ export interface AutocompleteSetters<TItem extends BaseItem> {
1313
*
1414
* Pass `null` to unselect items.
1515
*
16-
* @link https://autocomplete.algolia.com/docs/state#setactiveitemid
16+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state/#param-setactiveitemid
1717
*/
1818
setActiveItemId: StateUpdater<AutocompleteState<TItem>['activeItemId']>;
1919
/**
2020
* Sets the query.
2121
*
22-
* @link https://autocomplete.algolia.com/docs/state#setquery
22+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state/#param-setquery
2323
*/
2424
setQuery: StateUpdater<AutocompleteState<TItem>['query']>;
2525
/**
2626
* Sets the collections.
2727
*
28-
* @link https://autocomplete.algolia.com/docs/state#setcollections
28+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state/#param-setcollections
2929
*/
3030
setCollections: StateUpdater<
3131
Array<
@@ -35,21 +35,21 @@ export interface AutocompleteSetters<TItem extends BaseItem> {
3535
/**
3636
* Sets whether the panel is open or not.
3737
*
38-
* @link https://autocomplete.algolia.com/docs/state#setisopen
38+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state/#param-setisopen
3939
*/
4040
setIsOpen: StateUpdater<AutocompleteState<TItem>['isOpen']>;
4141
/**
4242
* Sets the status of the autocomplete.
4343
*
44-
* @link https://autocomplete.algolia.com/docs/state#setisopen
44+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state/#param-setisopen
4545
*/
4646
setStatus: StateUpdater<AutocompleteState<TItem>['status']>;
4747
/**
4848
* Sets the context passed to lifecycle hooks.
4949
*
50-
* See more in [**Context**](https://autocomplete.algolia.com/docs/context).
50+
* See more in [**Context**](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/context/).
5151
*
52-
* @link https://autocomplete.algolia.com/docs/state#setcontext
52+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state/#param-setcontext
5353
*/
5454
setContext: StateUpdater<AutocompleteState<TItem>['context']>;
5555
}

packages/autocomplete-core/src/types/AutocompleteSource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface AutocompleteSource<TItem extends BaseItem> {
3939
/**
4040
* The function called to get the URL of the item.
4141
*
42-
* The value is used to add [keyboard accessibility](https://autocomplete.algolia.com/docs/keyboard-navigation) features to let users open items in the current tab, a new tab, or a new window.
42+
* The value is used to add [keyboard accessibility](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/keyboard-navigation/) features to let users open items in the current tab, a new tab, or a new window.
4343
*/
4444
getItemUrl?({
4545
item,

packages/autocomplete-js/src/types/AutocompleteOptions.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface AutocompleteOptions<TItem extends BaseItem>
3939
*
4040
* You can either pass a [CSS selector](https://developer.mozilla.org/docs/Web/CSS/CSS_Selectors) or an [Element](https://developer.mozilla.org/docs/Web/API/HTMLElement). If there are several containers matching the selector, Autocomplete picks up the first one.
4141
*
42-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#container
42+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-container
4343
*/
4444
container: string | HTMLElement;
4545
/**
@@ -48,14 +48,14 @@ export interface AutocompleteOptions<TItem extends BaseItem>
4848
* You can either pass a [CSS selector](https://developer.mozilla.org/docs/Web/CSS/CSS_Selectors) or an [Element](https://developer.mozilla.org/docs/Web/API/HTMLElement). If there are several containers matching the selector, Autocomplete picks up the first one.
4949
*
5050
* @default document.body
51-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#panelcontainer
51+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-panelcontainer
5252
*/
5353
panelContainer?: string | HTMLElement;
5454
/**
5555
* The Media Query to turn Autocomplete into a detached experience.
5656
*
5757
* @default "(max-width: 680px)"
58-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#detachedmediaquery
58+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-detachedmediaquery
5959
* @link https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries
6060
*/
6161
detachedMediaQuery?: string;
@@ -64,48 +64,48 @@ export interface AutocompleteOptions<TItem extends BaseItem>
6464
* The panel's horizontal position.
6565
*
6666
* @default "input-wrapper-width"
67-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#panelplacement
67+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-panelplacement
6868
*/
6969
panelPlacement?: 'start' | 'end' | 'full-width' | 'input-wrapper-width';
7070
/**
7171
* Class names to inject for each created DOM element.
7272
*
7373
* This is useful to style your autocomplete with external CSS frameworks.
7474
*
75-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#classnames
75+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-classnames
7676
*/
7777
classNames?: Partial<AutocompleteClassNames>;
7878
/**
7979
* The function that renders the autocomplete panel.
8080
*
8181
* This is useful to customize the rendering, for example, using multi-row or multi-column layouts.
8282
*
83-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#render
83+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-render
8484
*/
8585
render?: AutocompleteRender<TItem>;
8686
/**
8787
* The function that renders a no results section when there are no hits.
8888
*
8989
* This is useful to let the user know that the query returned no results.
9090
*
91-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#rendernoresults
91+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-rendernoresults
9292
*/
9393
renderNoResults?: AutocompleteRender<TItem>;
9494
initialState?: Partial<AutocompleteState<TItem>>;
9595
onStateChange?(props: OnStateChangeProps<TItem>): void;
9696
/**
9797
* The virtual DOM implementation to plug to Autocomplete. It defaults to Preact.
9898
*
99-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#renderer
99+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-renderer
100100
*/
101101
renderer?: AutocompleteRenderer;
102102
plugins?: Array<AutocompletePlugin<any, any>>;
103103
/**
104104
* Components to register in the Autocomplete rendering lifecycles.
105105
*
106-
* Registered components become available in [`templates`](https://autocomplete.algolia.com/docs/autocomplete-jstemplates), [`render`](https://autocomplete.algolia.com/docs/autocomplete-js#render), and in [`renderNoResults`](https://autocomplete.algolia.com/docs/autocomplete-js#rendernoresults).
106+
* Registered components become available in [`templates`](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/templates/), [`render`](https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-render), and in [`renderNoResults`](https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-rendernoresults).
107107
*
108-
* @link https://autocomplete.algolia.com/docs/autocomplete-js#components
108+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-components
109109
*/
110110
components?: PublicAutocompleteComponents;
111111
}

packages/autocomplete-js/src/types/AutocompletePlugin.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ export type AutocompletePlugin<TItem extends BaseItem, TData> = Omit<
1010
'getSources'
1111
> & {
1212
/**
13-
* The function called when the internal state changes.
13+
* The [sources](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/) to get the suggestions from.
1414
*
15-
* @link https://autocomplete.algolia.com/docs/plugins#onstatechange
15+
* When defined, they’re merged with the sources of your Autocomplete instance.
16+
*
17+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/plugins/#param-getsources
1618
*/
1719
getSources?: AutocompleteOptions<TItem>['getSources'];
1820
};

packages/autocomplete-js/src/types/AutocompleteSource.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export type SourceTemplates<TItem extends BaseItem> = {
2424
/**
2525
* A function that returns the template for each item of the source.
2626
*
27-
* @link https://autocomplete.algolia.com/docs/templates/#item
27+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/templates/#param-item
2828
*/
2929
item: Template<{
3030
item: TItem;
@@ -33,7 +33,7 @@ export type SourceTemplates<TItem extends BaseItem> = {
3333
/**
3434
* A function that returns the template for the header (before the list of items).
3535
*
36-
* @link https://autocomplete.algolia.com/docs/templates/#header
36+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/templates/#param-header
3737
*/
3838
header?: Template<{
3939
state: AutocompleteState<TItem>;
@@ -43,7 +43,7 @@ export type SourceTemplates<TItem extends BaseItem> = {
4343
/**
4444
* A function that returns the template for the footer (after the list of items).
4545
*
46-
* @link https://autocomplete.algolia.com/docs/templates/#footer
46+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/templates/#param-footer
4747
*/
4848
footer?: Template<{
4949
state: AutocompleteState<TItem>;
@@ -53,7 +53,7 @@ export type SourceTemplates<TItem extends BaseItem> = {
5353
/**
5454
* A function that returns the template for when there are no items.
5555
*
56-
* @link https://autocomplete.algolia.com/docs/templates/#noresults
56+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/templates/#param-noresults
5757
*/
5858
noResults?: Template<{
5959
state: AutocompleteState<TItem>;
@@ -67,7 +67,7 @@ type WithTemplates<TType, TItem extends BaseItem> = TType & {
6767
*
6868
* See [**Displaying items with Templates**](templates) for more information.
6969
*
70-
* @link https://autocomplete.algolia.com/docs/sources/#templates
70+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-templates
7171
*/
7272
templates: SourceTemplates<TItem>;
7373
};

packages/autocomplete-js/src/types/AutocompleteState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export type AutocompleteState<TItem extends BaseItem> = Omit<
1212
/**
1313
* The collections of items.
1414
*
15-
* @link https://autocomplete.algolia.com/docs/state/#collections
15+
* @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state/#param-collections
1616
*/
1717
collections: Array<AutocompleteCollection<TItem>>;
1818
};

0 commit comments

Comments
 (0)