mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Cloud Security] use as const for const dicts for TS to infer correct types (#180566)
## Summary using `as const` on exported const objects to allow TS infer the narrowest possible types Follow up on the CR comment - https://github.com/elastic/kibana/pull/179031#discussion_r1549592678
This commit is contained in:
parent
d719c89190
commit
73d853300f
3 changed files with 6 additions and 4 deletions
|
@ -44,7 +44,7 @@ export type SetupFormat = typeof AWS_SETUP_FORMAT.CLOUD_FORMATION | typeof AWS_S
|
|||
export const AWS_SETUP_FORMAT = {
|
||||
CLOUD_FORMATION: 'cloud_formation',
|
||||
MANUAL: 'manual',
|
||||
};
|
||||
} as const;
|
||||
|
||||
export const AWS_CREDENTIALS_TYPE = {
|
||||
ASSUME_ROLE: 'assume_role',
|
||||
|
@ -53,6 +53,7 @@ export const AWS_CREDENTIALS_TYPE = {
|
|||
SHARED_CREDENTIALS: 'shared_credentials',
|
||||
CLOUD_FORMATION: 'cloud_formation',
|
||||
} as const;
|
||||
|
||||
export const AWSSetupInfoContent = ({ info }: AWSSetupInfoContentProps) => {
|
||||
return (
|
||||
<>
|
||||
|
|
|
@ -45,7 +45,7 @@ export type SetupFormat = typeof AZURE_SETUP_FORMAT.ARM_TEMPLATE | typeof AZURE_
|
|||
export const AZURE_SETUP_FORMAT = {
|
||||
ARM_TEMPLATE: 'arm_template',
|
||||
MANUAL: 'manual',
|
||||
};
|
||||
} as const;
|
||||
|
||||
export const AZURE_CREDENTIALS_TYPE = {
|
||||
ARM_TEMPLATE: 'arm_template',
|
||||
|
|
|
@ -46,15 +46,16 @@ import {
|
|||
export const GCP_SETUP_ACCESS = {
|
||||
CLOUD_SHELL: 'google_cloud_shell',
|
||||
MANUAL: 'manual',
|
||||
};
|
||||
} as const;
|
||||
|
||||
export const GCP_CREDENTIALS_TYPE = {
|
||||
CREDENTIALS_FILE: 'credentials-file',
|
||||
CREDENTIALS_JSON: 'credentials-json',
|
||||
CREDENTIALS_NONE: 'credentials-none',
|
||||
};
|
||||
} as const;
|
||||
|
||||
type SetupFormatGCP = typeof GCP_SETUP_ACCESS.CLOUD_SHELL | typeof GCP_SETUP_ACCESS.MANUAL;
|
||||
|
||||
export const GCPSetupInfoContent = () => (
|
||||
<>
|
||||
<EuiHorizontalRule margin="xl" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue