type ProductDimensionsData = {
	product_id: string | number
	product_name?: string
	quantity?: number
	skip_row: boolean
	manually_added?: boolean
	weight: string
	height: string
	length: string
	width: string
}

type SendersData = {
	id: number,
	name: string,
	address_1: string,
	address_2: string,
	zipcode: number,
	city: string,
	country: string
	selected?: boolean
}

type CarriersData = {
	name: string
	service_id: string
}

type MyResponse<dataType> = {
	error?: string
	url?: string
	data?: dataType
	message?: string
	code?: number
	error_code?: string
}

type RequestData = {
	action?: string
	wetail_shipping_nonce?: string
	order_id?: string
	order_ids?: Array
	updated_dimensions?: ProductDimensionsData[]
	total_order_weight?: string
	shipping_service_id?: string
	selected_carrier_id?: string
	selected_sender_id?: string
	pickup_time?: string
	label_id?: string
}

interface Window {
	ajaxurl: string,
	print_label_pickup_time_need: boolean,
	wp: {
		template: ( templateId: string ) => ( templateData: Object ) => HTMLElement
	},
	_wetail_shipping: {
		return_service_options_data: Array<CarriersData>;
		i18n: {
			[ key: string ]: string
		}
		settings: {
			create_labels_manually: boolean
			enable_manual_shipping_service_selection_override: boolean
			has_multiple_senders: boolean
			book_pickup_manually: boolean
			license_key_is_set: boolean
		},
		wetail_shipping_nonce: string
		error_code: string
	},
	__wetail_shipping_return_portal: {
		ajaxurl: string,
		nonce: string
		order_number: number | undefined,
		order_password: string | undefined,
		return_carrier: 'postnord' | 'bring' | 'db_schenker' | 'dhl',
		i18n: {
			order_verification_error: string
			email_error: string
			field_empty_error: string
			phone_error: string,
			bring_return_number_message: string
		}
	}
}
