Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript error in config object of enable() #9

Closed
frederikheld opened this issue May 17, 2024 · 3 comments · Fixed by #10
Closed

TypeScript error in config object of enable() #9

frederikheld opened this issue May 17, 2024 · 3 comments · Fixed by #10

Comments

@frederikheld
Copy link

Describe the bug
VSCode gives me the following TypeScript error:

Object literal may only specify known properties, and 'customColorsForSystemBars' does not exist in type '{ config: Config; }'.ts(2353)
(property) customColorsForSystemBars: boolean

To Reproduce
Use the code from the usage example in README.md in a TS project

Expected behavior
There should be no TS error. So either the typings need to be fixed or the documentation.

@frederikheld
Copy link
Author

frederikheld commented May 17, 2024

Actually, the docs are wrong. Following the type hints, this is how the config should look like:

import { SafeArea } from '@capacitor-community/safe-area';

SafeArea.enable({
  config: {
    customColorsForSystemBars: true,
    statusBarColor: '#00000000', // transparent
    statusBarContent: 'light',
    navigationBarColor: '#00000000', // transparent
    navigationBarContent: 'light',
  }
});

@tafelnl
Copy link
Member

tafelnl commented May 17, 2024

Good catch. I'll update the docs accordingly

@frederikheld
Copy link
Author

Thanks for fixing this so quickly :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants