Skip to content

Commit

Permalink
MVP-274: Added types to docs (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
BradyMitch authored Jun 3, 2024
2 parents 27ff6ce + 8f6d18a commit a9d2f9b
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-techdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches: [ main ]
paths:
- "mkdocs.yml"
- "techdocs/docs/*"
- "techdocs/docs/**"
- "catalog-info.yaml"

jobs:
Expand Down
6 changes: 6 additions & 0 deletions techdocs/docs/using-the-package/apis-&-components/provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ root.render(
);
```

## TypeScript Type

```TypeScript
(props: SSOProviderProps) => react_jsx_runtime.JSX.Element;
```

## Props

An API reference for the props of the `SSOProvider` component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ export const RoleMessage = () => {
By default, all roles in the array will be required.
If you wish to require only one of a list of roles, add the options parameter with `requireAllRoles` property set to `false`.

## TypeScript Type

```TypeScript
(roles: string[], options?: HasRolesOptions) => boolean;
```

## Parameters

An API reference for the parameters of the `hasRoles` function.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ export const LoginButton = () => {
}
```

## TypeScript Type

```TypeScript
(options?: LoginProps) => void;
```

## Parameters

An API reference for the parameters of the `login` function.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ export const LogoutButton = () => {
}
```

## TypeScript Type

```TypeScript
(backendURL?: string) => void;
```

## Parameters

An API reference for the parameters of the `logout` function.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,31 @@ export const UserInfo = () => {
}
```
## TypeScript Type
Type is `SSOUser`.
```TypeScript
{
guid: string;
preferred_username: string; // Use as unique identifier for user.
username: string;
first_name: string;
last_name: string;
display_name: string;
email: string;
identity_provider: IdentityProvider;
client_roles?: string[];
scope?: string;
name?: string;
originalData: OriginalSSOUser;
};
```
## Properties
An API reference for the properties of the `user` state.
`user` is of type `SSOUser`.
<table>
<!-- Table columns -->
<thead>
Expand All @@ -42,7 +61,7 @@ An API reference for the properties of the `user` state.
<!-- Table rows -->
<tbody>
<tr>
<tr>
<td>guid</td>
<td>string</td>
<td>Unique user identifier string.</td>
Expand Down
6 changes: 6 additions & 0 deletions techdocs/docs/using-the-package/apis-&-components/usesso.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ export const UserInfo = () => {
}
```
## TypeScript Type
```TypeScript
() => AuthService;
```
## Hook Actions
An API reference for the actions of the `useSSO` hook.
Expand Down

0 comments on commit a9d2f9b

Please sign in to comment.