Add more typings & refactor code accordingly

Change-type: patch
Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzothunder.ambrosi@gmail.com>
This commit is contained in:
Lorenzo Alberto Maria Ambrosi 2020-09-03 15:46:18 +02:00
parent c6cd421f17
commit 2e3978b3c9

View File

@ -72,24 +72,24 @@ export function getImage(): SourceMetadata | undefined {
return store.getState().toJS().selection.image;
}
export function getImagePath() {
return getImage()?.path;
export function getImagePath(): string | undefined {
return store.getState().toJS().selection.image?.path;
}
export function getImageSize() {
return getImage()?.size;
export function getImageSize(): number | undefined {
return store.getState().toJS().selection.image?.size;
}
export function getImageName() {
return getImage()?.name;
export function getImageName(): string | undefined {
return store.getState().toJS().selection.image?.name;
}
export function getImageLogo() {
return getImage()?.logo;
export function getImageLogo(): string | undefined {
return store.getState().toJS().selection.image?.logo;
}
export function getImageSupportUrl() {
return getImage()?.supportUrl;
export function getImageSupportUrl(): string | undefined {
return store.getState().toJS().selection.image?.supportUrl;
}
/**