How can I check if a selection is active?

Hi,
can you help me in writing a condition to check if a selection is active in Photoshop?

In ExtendScript I could do something like this: app.activeDocument.selection.bounds

Is there anything similar in UXP?

Thank you very much.

I have found a solution thanks to another topic in this forum

		const obj = {
			'_obj': 'get',
			'_target': [
				{'_property': 'selection'},
				{'_ref': 'document', '_enum': 'ordinal', '_value': 'targetEnum'}
			],
			'_options': {'dialogOptions': 'silent'}
		};
		await action.batchPlay([obj], {});