Skip to content

Commit

Permalink
docs: tsdoc @example code snippet format (#62, #67)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Philip Johnson <[email protected]>
Co-authored-by: Daniel Philip Johnson <[email protected]>
Co-authored-by: lihbr <[email protected]>
  • Loading branch information
4 people authored Jul 6, 2023
1 parent 7dd808f commit eeaddc4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
9 changes: 6 additions & 3 deletions src/components/SliceZone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,19 +156,21 @@ export type DefineComponentSliceComponentProps<
*
* Props are: `["slice", "index", "slices", "context"]`
*
* @example Defining a new slice component:
* @example
*
* ```javascript
* // Defining a new slice component
* import { getSliceComponentProps } from "@prismicio/vue";
*
* export default {
* props: getSliceComponentProps(),
* };
* ```
*
* @example Defining a new slice component with visual hint:
* @example
*
* ```javascript
* // Defining a new slice component with visual hint
* import { getSliceComponentProps } from "@prismicio/vue";
*
* export default {
Expand Down Expand Up @@ -302,9 +304,10 @@ export type SliceZoneComponents<
* @remarks
* This is essentially an helper function to ensure {@link markRaw} is correctly
* applied on each components, improving performances.
* @example Defining a slice components:
* @example
*
* ```javascript
* // Defining a slice components
* import { defineSliceZoneComponents } from "@prismicio/vue";
*
* export default {
Expand Down
18 changes: 11 additions & 7 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,15 @@ type PrismicPluginOptionsWithEndpoint = PrismicPluginOptionsBase & {
* Said client will be used by `@prismicio/vue` composables, such as
* {@link usePrismicDocuments} and exposed through `this.$prismic.client` and
* `usePrismic().client`.
* @example A repository ID:
* @example
*
* "my-repo";
*
* @example A full repository endpoint:
* ```javascript
* // A repository ID
* "my-repo";
*
* "https://my-repo.cdn.prismic.io/api/v2";
* //A full repository endpoint
* "https://my-repo.cdn.prismic.io/api/v2";
* ```
*
* @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}
*/
Expand All @@ -226,17 +228,19 @@ type PrismicPluginOptionsWithEndpoint = PrismicPluginOptionsBase & {
/**
* An optional object to configure `@prismicio/client` instance further.
*
* @example Accessing a private private repository:
* @example
*
* ```javascript
* // Accessing a private private repository
* {
* "accessToken": "abc"
* }
* ```
*
* @example Using a route resolver:
* @example
*
* ```javascript
* // Using a route resolver
* {
* "defaultParams": {
* "routes": [
Expand Down
3 changes: 2 additions & 1 deletion src/usePrismic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import { prismicKey } from "./injectionSymbols";
/**
* Accesses `@prismicio/vue` plugin interface.
*
* @example With the composition API:
* @example
*
* ```javascript
* // With the composition API
* import { usePrismic } from "@prismicio/vue";
*
* export default {
Expand Down

0 comments on commit eeaddc4

Please sign in to comment.