use std::any::Any;
use alchemy_styles::styles::{Appearance, Layout};
use crate::error::Error;
use crate::reconciler::key::ComponentKey;
use crate::rsx::RSX;
#[cfg(feature = "cocoa")]
pub type PlatformSpecificNodeType = objc_id::ShareId<objc::runtime::Object>;
#[cfg(not(feature = "cocoa"))]
pub type PlatformSpecificNodeType = ();
pub trait AppDelegate: Send + Sync {
fn will_finish_launching(&mut self) {}
fn did_finish_launching(&mut self) {}
fn will_become_active(&mut self) {}
fn did_become_active(&mut self) {}
fn will_resign_active(&mut self) {}
fn did_resign_active(&mut self) {}
fn should_terminate(&self) -> bool { true }
fn will_terminate(&mut self) {}
fn _window_will_close(&self, _window_id: usize) {}
}
pub trait WindowDelegate: Send + Sync {
fn will_close(&mut self) { }
fn render(&self) -> Result<RSX, Error> { Ok(RSX::None) }
}
pub trait Props {
fn set_props(&mut self, new_props: &mut Any);
}
pub trait Component: Props + Send + Sync {
fn new(key: ComponentKey) -> Self where Self: Sized;
fn has_native_backing_node(&self) -> bool { false }
fn borrow_native_backing_node(&self) -> Option<PlatformSpecificNodeType> { None }
fn append_child_node(&self, _component: PlatformSpecificNodeType) {}
fn replace_child_node(&self, _component: PlatformSpecificNodeType) {}
fn remove_child_node(&self, _component: PlatformSpecificNodeType) {}
fn apply_styles(&self, _appearance: &Appearance, _layout: &Layout) {}
fn get_derived_state_from_props(&self) {}
fn get_snapshot_before_update(&self) {}
fn component_did_mount(&mut self) {}
fn component_did_update(&mut self) {}
fn component_will_unmount(&mut self) {}
fn component_did_catch(&mut self ) {}
fn should_component_update(&self) -> bool { true }
fn render(&self, children: Vec<RSX>) -> Result<RSX, Error> { Ok(RSX::None) }
fn get_derived_state_from_error(&self, _error: ()) {}
fn force_update(&self) {}
}