use std::sync::Arc;
use std::sync::LazyLock;
use mago_atom::empty_atom;
use crate::ttype::atomic::TAtomic;
use crate::ttype::atomic::array::TArray;
use crate::ttype::atomic::array::keyed::TKeyedArray;
use crate::ttype::atomic::callable::TCallable;
use crate::ttype::atomic::callable::TCallableSignature;
use crate::ttype::atomic::iterable::TIterable;
use crate::ttype::atomic::mixed::TMixed;
use crate::ttype::atomic::object::TObject;
use crate::ttype::atomic::resource::TResource;
use crate::ttype::atomic::scalar::TScalar;
use crate::ttype::atomic::scalar::int::TInteger;
use crate::ttype::atomic::scalar::string::TString;
use crate::ttype::atomic::scalar::string::TStringLiteral;
use crate::ttype::get_arraykey;
use crate::ttype::get_mixed;
use super::atomic::scalar::string::TStringCasing;
pub const ONE_INT_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::literal_int(1));
pub const ZERO_INT_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::literal_int(0));
pub const MINUS_ONE_INT_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::literal_int(-1));
pub const INT_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::int());
pub const POSITIVE_INT_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::Integer(TInteger::positive()));
pub const NON_POSITIVE_INT_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::Integer(TInteger::non_positive()));
pub const NEGATIVE_INT_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::Integer(TInteger::negative()));
pub const NON_NEGATIVE_INT_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::Integer(TInteger::non_negative()));
pub const UNSPECIFIED_LITERAL_INT_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::Integer(TInteger::UnspecifiedLiteral));
pub const STRING_ATOMIC: &TAtomic =
&TAtomic::Scalar(TScalar::String(TString::new(None, false, false, false, TStringCasing::Unspecified)));
pub const LOWERCASE_STRING_ATOMIC: &TAtomic =
&TAtomic::Scalar(TScalar::String(TString::new(None, false, false, false, TStringCasing::Lowercase)));
pub const UPPERCASE_STRING_ATOMIC: &TAtomic =
&TAtomic::Scalar(TScalar::String(TString::new(None, false, false, false, TStringCasing::Uppercase)));
pub const NON_EMPTY_STRING_ATOMIC: &TAtomic =
&TAtomic::Scalar(TScalar::String(TString::new(None, false, false, true, TStringCasing::Unspecified)));
pub const NON_EMPTY_LOWERCASE_STRING_ATOMIC: &TAtomic =
&TAtomic::Scalar(TScalar::String(TString::new(None, false, false, true, TStringCasing::Lowercase)));
pub const NON_EMPTY_UPPERCASE_STRING_ATOMIC: &TAtomic =
&TAtomic::Scalar(TScalar::String(TString::new(None, false, false, true, TStringCasing::Uppercase)));
pub const TRUTHY_STRING_ATOMIC: &TAtomic =
&TAtomic::Scalar(TScalar::String(TString::new(None, false, true, false, TStringCasing::Unspecified)));
pub const TRUTHY_LOWERCASE_STRING_ATOMIC: &TAtomic =
&TAtomic::Scalar(TScalar::String(TString::new(None, false, true, false, TStringCasing::Lowercase)));
pub const TRUTHY_UPPERCASE_STRING_ATOMIC: &TAtomic =
&TAtomic::Scalar(TScalar::String(TString::new(None, false, true, false, TStringCasing::Uppercase)));
pub const NUMERIC_STRING_ATOMIC: &TAtomic =
&TAtomic::Scalar(TScalar::String(TString::new(None, true, false, false, TStringCasing::Unspecified)));
pub const NUMERIC_TRUTHY_STRING_ATOMIC: &TAtomic =
&TAtomic::Scalar(TScalar::String(TString::new(None, true, true, false, TStringCasing::Unspecified)));
pub const CLASS_STRING_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::class_string());
pub const INTERFACE_STRING_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::interface_string());
pub const ENUM_STRING_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::enum_string());
pub const TRAIT_STRING_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::trait_string());
pub const FLOAT_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::float());
pub const UNSPECIFIED_LITERAL_FLOAT_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::unspecified_literal_float());
pub const MIXED_ATOMIC: &TAtomic = &TAtomic::Mixed(TMixed::new());
pub const ISSET_FROM_LOOP_MIXED_ATOMIC: &TAtomic = &TAtomic::Mixed(TMixed::isset_from_loop());
pub const NEVER_ATOMIC: &TAtomic = &TAtomic::Never;
pub const NON_NULL_ATOMIC: &TAtomic = &TAtomic::Mixed(TMixed::non_null());
pub const FALSY_MIXED_ATOMIC: &TAtomic = &TAtomic::Mixed(TMixed::falsy());
pub const TRUTHY_MIXED_ATOMIC: &TAtomic = &TAtomic::Mixed(TMixed::truthy());
pub const RESOURCE_ATOMIC: &TAtomic = &TAtomic::Resource(TResource::new(None));
pub const OPEN_RESOURCE_ATOMIC: &TAtomic = &TAtomic::Resource(TResource::open());
pub const CLOSED_RESOURCE_ATOMIC: &TAtomic = &TAtomic::Resource(TResource::closed());
pub const PLACEHOLDER_ATOMIC: &TAtomic = &TAtomic::Placeholder;
pub const VOID_ATOMIC: &TAtomic = &TAtomic::Void;
pub const NULL_ATOMIC: &TAtomic = &TAtomic::Null;
pub const ARRAYKEY_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::ArrayKey);
pub const BOOL_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::bool());
pub const FALSE_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::r#false());
pub const TRUE_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::r#true());
pub const OBJECT_ATOMIC: &TAtomic = &TAtomic::Object(TObject::Any);
pub const NUMERIC_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::Numeric);
pub static EMPTY_STRING_ATOMIC: LazyLock<TAtomic> = LazyLock::new(|| {
TAtomic::Scalar(TScalar::String(TString {
literal: Some(TStringLiteral::Value(empty_atom())),
is_numeric: false,
is_truthy: false,
is_non_empty: false,
casing: TStringCasing::Unspecified,
}))
});
pub const UNSPECIFIED_LITERAL_STRING_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::unspecified_literal_string(false));
pub const NON_EMPTY_UNSPECIFIED_LITERAL_STRING_ATOMIC: &TAtomic =
&TAtomic::Scalar(TScalar::unspecified_literal_string(true));
pub const SCALAR_ATOMIC: &TAtomic = &TAtomic::Scalar(TScalar::Generic);
pub static MIXED_ITERABLE_ATOMIC: LazyLock<TAtomic> = LazyLock::new(|| {
TAtomic::Iterable(TIterable {
key_type: Arc::new(get_mixed()),
value_type: Arc::new(get_mixed()),
intersection_types: None,
})
});
pub static EMPTY_KEYED_ARRAY_ATOMIC: LazyLock<TAtomic> =
LazyLock::new(|| TAtomic::Array(TArray::Keyed(TKeyedArray::new())));
pub static MIXED_KEYED_ARRAY_ATOMIC: LazyLock<TAtomic> = LazyLock::new(|| {
TAtomic::Array(TArray::Keyed(TKeyedArray::new_with_parameters(Arc::new(get_arraykey()), Arc::new(get_mixed()))))
});
pub static MIXED_CALLABLE_ATOMIC: LazyLock<TAtomic> =
LazyLock::new(|| TAtomic::Callable(TCallable::Signature(TCallableSignature::mixed(false))));
pub static MIXED_CLOSURE_ATOMIC: LazyLock<TAtomic> =
LazyLock::new(|| TAtomic::Callable(TCallable::Signature(TCallableSignature::mixed(true))));
pub const INT_FLOAT_ATOMIC_SLICE: &[TAtomic] = &[TAtomic::Scalar(TScalar::int()), TAtomic::Scalar(TScalar::float())];
pub const INT_STRING_ATOMIC_SLICE: &[TAtomic] = &[TAtomic::Scalar(TScalar::int()), TAtomic::Scalar(TScalar::string())];
pub const NULL_SCALAR_ATOMIC_SLICE: &[TAtomic] = &[TAtomic::Null, TAtomic::Scalar(TScalar::Generic)];
pub const NULL_STRING_ATOMIC_SLICE: &[TAtomic] = &[TAtomic::Null, TAtomic::Scalar(TScalar::string())];
pub const NULL_INT_ATOMIC_SLICE: &[TAtomic] = &[TAtomic::Null, TAtomic::Scalar(TScalar::int())];
pub const NULL_FLOAT_ATOMIC_SLICE: &[TAtomic] = &[TAtomic::Null, TAtomic::Scalar(TScalar::float())];
pub const NULL_OBJECT_ATOMIC_SLICE: &[TAtomic] = &[TAtomic::Null, TAtomic::Object(TObject::Any)];
pub const SIGNUM_RESULT_SLICE: &[TAtomic] = &[
TAtomic::Scalar(TScalar::literal_int(-1)),
TAtomic::Scalar(TScalar::literal_int(0)),
TAtomic::Scalar(TScalar::literal_int(1)),
];