feat(mobile): ios oauth & magic-link login (#8581)

Co-authored-by: EYHN <cneyhn@gmail.com>
This commit is contained in:
Cats Juice
2024-10-28 14:12:33 +08:00
committed by GitHub
parent d6ec4cc597
commit 06dda70319
59 changed files with 929 additions and 219 deletions

View File

@@ -1,4 +1,3 @@
import type { Component } from './components/component';
import type { Entity } from './components/entity';
import type { Scope } from './components/scope';
import type { Service } from './components/service';
@@ -408,8 +407,6 @@ class FrameworkEditor {
*
* @example
* ```ts
* override(OriginClass, NewClass, [dependencies, ...])
* or
* override(Identifier, Class, [dependencies, ...])
* or
* override(Identifier, Instance)
@@ -418,10 +415,10 @@ class FrameworkEditor {
* ```
*/
override = <
Arg1 extends GeneralIdentifier<any>,
Arg2 extends Type<Trait> | ComponentFactory<Trait> | Trait | null,
Arg1 extends Identifier<any>,
Arg2 extends Type<Trait> | ComponentFactory<Trait> | Trait,
Arg3 extends Deps,
Trait extends Component = IdentifierType<Arg1>,
Trait = IdentifierType<Arg1>,
Deps = Arg2 extends Type<Trait>
? TypesToDeps<ConstructorParameters<Arg2>>
: [],

View File

@@ -55,7 +55,7 @@ export abstract class FrameworkProvider {
getOptional = <T>(
identifier: GeneralIdentifier<T>,
options?: ResolveOptions
): T | null => {
): T | undefined => {
return this.getRaw(parseIdentifier(identifier), {
...options,
optional: true,

View File

@@ -23,7 +23,7 @@ export function useService<T extends Service>(
): T {
const stack = useContext(FrameworkStackContext);
let service: T | null = null;
let service: T | undefined = undefined;
for (let i = stack.length - 1; i >= 0; i--) {
service = stack[i].getOptional(identifier, {
@@ -87,10 +87,10 @@ export function useServices<
export function useServiceOptional<T extends Service>(
identifier: Type<T>
): T | null {
): T | undefined {
const stack = useContext(FrameworkStackContext);
let service: T | null = null;
let service: T | undefined = undefined;
for (let i = stack.length - 1; i >= 0; i--) {
service = stack[i].getOptional(identifier, {