Skip to content

Commit

Permalink
[notifications] tweak types and export missing ones (expo#27464)
Browse files Browse the repository at this point in the history
  • Loading branch information
Simek authored Mar 6, 2024
1 parent d0b2194 commit 7fc5071
Show file tree
Hide file tree
Showing 25 changed files with 96 additions and 71 deletions.
17 changes: 12 additions & 5 deletions docs/components/plugins/__snapshots__/APISection.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8302,7 +8302,8 @@ in order to enable/disable the permission.
</a>
</code>
extended by:
extended by
:
</p>
<br />
<div
Expand Down Expand Up @@ -9281,8 +9282,11 @@ you don't get this value.
>
PermissionHookBehavior
</code>
<span>
<span
class="css-1hmnf1v-TextComponent"
data-text="true"
>
|
</span>
</span>
<span>
Expand Down Expand Up @@ -11206,8 +11210,11 @@ in order to enable/disable the permission.
>
'never'
</code>
<span>
<span
class="css-1hmnf1v-TextComponent"
data-text="true"
>
|
</span>
</span>
<span>
Expand Down
19 changes: 14 additions & 5 deletions docs/components/plugins/api/APISectionTypes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,20 @@ const renderType = ({
</MONOSPACE>
</H3Code>
<CommentTextBlock comment={comment} includePlatforms={false} />
{type.type === 'intersection' ? (
{type.type === 'intersection' || type.type === 'union' ? (
<>
<P>
{type.types
.filter(type => ['reference', 'union', 'intersection'].includes(type.type))
.filter(type =>
['reference', 'union', 'intersection', 'intrinsic'].includes(type.type)
)
.map(validType => (
<Fragment key={`nested-reference-type-${validType.name}`}>
<CODE>{resolveTypeName(validType)}</CODE>{' '}
<CODE>{resolveTypeName(validType)}</CODE>
{type.type === 'union' ? ' or ' : ' '}
</Fragment>
))}
extended by:
{type.type === 'union' ? 'object shaped as below' : 'extended by'}:
</P>
<br />
</>
Expand Down Expand Up @@ -187,7 +190,13 @@ const renderType = ({
{literalTypes.map((lt, index) => (
<span key={`${name}-literal-type-${index}`}>
<CODE>{resolveTypeName(lt)}</CODE>
{index + 1 !== literalTypes.length ? <span>&ensp;</span> : ''}
{index + 1 !== literalTypes.length ? (
<CALLOUT tag="span" theme="quaternary">
{' | '}
</CALLOUT>
) : (
''
)}
</span>
))}
</P>
Expand Down
5 changes: 5 additions & 0 deletions docs/components/plugins/api/APISectionUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const nonLinkableTypes = [
'PureComponent',
'E',
'EventSubscription',
'K',
'Listener',
'NativeSyntheticEvent',
'ParsedQs',
Expand Down Expand Up @@ -169,6 +170,8 @@ const hardcodedTypeLinks: Record<string, string> = {
DeviceSensor: '/versions/latest/sdk/sensors',
Element: 'https://www.typescriptlang.org/docs/handbook/jsx.html#function-component',
Error: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error',
Exclude:
'https://www.typescriptlang.org/docs/handbook/utility-types.html#excludeuniontype-excludedmembers',
ExpoConfig:
'https://github.com/expo/expo/blob/main/packages/%40expo/config-types/src/ExpoConfig.ts',
ExpoUpdatesManifest: '/versions/latest/sdk/updates/#expoupdatesmanifest',
Expand All @@ -182,9 +185,11 @@ const hardcodedTypeLinks: Record<string, string> = {
Omit: 'https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys',
Pick: 'https://www.typescriptlang.org/docs/handbook/utility-types.html#picktype-keys',
Partial: 'https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype',
Platform: 'https://reactnative.dev/docs/platform',
Promise:
'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise',
ReactNode: 'https://reactnative.dev/docs/react-node',
Required: 'https://www.typescriptlang.org/docs/handbook/utility-types.html#requiredtype',
ShareOptions: 'https://reactnative.dev/docs/share#share',
SyntheticEvent: 'https://react.dev/reference/react-dom/components/common#react-event-object',
View: 'https://reactnative.dev/docs/view',
Expand Down

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 2 additions & 14 deletions packages/expo-notifications/build/NotificationScheduler.types.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7fc5071

Please sign in to comment.