how i can omit getters,setters,methods in Partial<> data ?
Or existe a way to get this kind of architecture with typescript ?
I need a types with full access, and a types without readOnly.
I try make a small example here, see note://
export const $A = (() => {
class A {
_uid?: string = 'generateUID()';
_title?: string = '';
children?: A[] = [];
B?: InstanceType<typeof $B['B']> = $B.create();
get Title() {
return this._title || this._uid;
}
constructor(data: Partial<A> = {}) {
Object.assign(this, data);
}
getFullTitle() {
return this._title + this._uid;
}
}
function create(data?: Partial<A>) {
return new A(data);
}
function renderer(A: A) {
//#1 Allow full access public A in this renderer entity
const { Title, _title, _uid } = A; // acces all props autorized here
const fulltitle = A.getFullTitle(); // acces methods autorized here
const childTitle = A.children[0]?.Title; // acces child props autorized here
}
return {
create,
renderer,
A,
};
})();
export const $B = (() => {
class B {
_foo?: string = '';
get Foo() {
return this._foo + 'foo';
}
constructor(data: Partial<B> = {}) {
Object.assign(this, data);
}
}
function create(data?: Partial<B>) {
return new B(data);
}
function renderer(B: B) {}
return {
create,
renderer,
B,
};
})();
// API
//#2 Partial props only (omit methods,getter,setter) for a higth level API !
$A.create({ Title: '' }); // should not visible and lint error !
$A.create({ getFullTitle: () => '' }); // should not visible and lint error !
// want allow only this structure for higth API
$A.create({
_title: '',
_uid: '',
B: $B.create(),
children: [$A.create({ _title: '', _uid: '' }), $A.create({ _title: '', _uid: '' })],
});
What i want is inside function renderer(A: A) { able to use all public props methodes,getter,setters.
And inside function create(data?: Partial<A>) allow only partial datas (without getters,setters,methodes).
So i want a trick to for get only yellow props here, when i use create()

I try many scenario without success, Always hit a wall somewhere ! if you have a another's way to structure this ? thanks