Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import * as React from 'react';
import { ViewProperties } from 'react-native';

export interface BlurViewProperties {
blurType: 'xlight' | 'light' | 'dark'
// tvOS only
| 'extraDark' | 'regular' | 'prominent';
blurAmount?: number; // 0 - 100

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we be more precise about the range?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Kureev, the only possible way to do it currently would be to have a enum like:

blurAmount?: 0 | 1 | 2 | 3 | ... | 99 | 100;

This issue on Typescript is exactly what we are looking for, but it looks like there is currently no clean way to do it, appart using an enum microsoft/TypeScript#15480 👀

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, got it! Thanks for the insight! Then I think it isn't a problem

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't viewRef be in there as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arnibarnason doesn't the extends React.Component does this?

style?: ViewProperties;
}

export class BlurView extends React.Component<BlurViewProperties, {}> {}


export interface VibrancyViewProperties extends BlurView {}

export class VibrancyView extends React.Component<BlurViewProperties, {}> {}