Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

deprecate other @obj#825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Freddy03h merged 2 commits intomainfromdeprecate_obj
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletionssrc/apis/Animated.res
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -207,9 +207,9 @@ external parallel: (array<Animation.t>, parallelPayload) => Animation.t = "paral
@module("react-native") @scope("Animated")
external stagger: (float, array<Animation.t>) => Animation.t = "stagger"

type loopConfig

@objexternal loopConfig: (~iterations: int) => loopConfig = ""
type loopConfig = {iterations?: int, resetBeforeIteration?: bool}
@deprecated("Directly create record instead") @obj
external loopConfig: (~iterations: int=?, ~resetBeforeIteration: bool=?) => loopConfig = ""

// multiple externals
@module("react-native") @scope("Animated")
Expand All@@ -219,22 +219,26 @@ external loop: Animation.t => Animation.t = "loop"
@module("react-native") @scope("Animated")
external loopWithConfig: (Animation.t, loopConfig) => Animation.t = "loop"

type eventOptions<'a>
@obj
type eventOptions<'a, 'platformConfig> = {
listener?: 'a,
useNativeDriver: bool,
platformConfig?: 'platformConfig,
}
@deprecated("Directly create record instead") @obj
external eventOptions: (
~listener: 'a=?,
~useNativeDriver: bool,
~platformConfig: 'platformConfig=?,
unit,
) => eventOptions<'a> = ""
) => eventOptions<'a, 'platformConfig> = ""

// multiple externals
@module("react-native") @scope("Animated")
external event1: (array<'mapping>, eventOptions<'a>) => 'a = "event"
external event1: (array<'mapping>, eventOptions<'a, 'platformConfig>) => 'a = "event"

// multiple externals
@module("react-native") @scope("Animated")
external event2: (('mapping1, 'mapping2), eventOptions<'a>) => 'a = "event"
external event2: (('mapping1, 'mapping2), eventOptions<'a, 'platformConfig>) => 'a = "event"

@module("react-native") @scope("Animated")
external createAnimatedComponent: React.component<'props> => React.component<'props> =
Expand Down
14 changes: 9 additions & 5 deletionssrc/apis/AppRegistry.res
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,16 +15,20 @@ type appParameters

external asAppParameters: 'a => appParameters = "%identity"

type appConfig

@obj
type appConfig<'a> = {
appKey: string,
component?: componentProvider<'a>,
run?: appParameters => unit,
section?: bool,
}
@deprecated("Directly create record instead") @obj
external appConfig: (
~appKey: string,
~component: componentProvider<'a>=?,
~run: appParameters => unit=?,
~section: bool=?,
unit,
) => appConfig = ""
) => appConfig<'a> = ""

type runnable<'a> = {
"component": Js.Nullable.t<componentProvider<'a>>,
Expand DownExpand Up@@ -62,7 +66,7 @@ external registerComponentWithSection: (appKey, componentProvider<'a>, section)
"registerComponent"

@module("react-native") @scope("AppRegistry")
external registerConfig: array<appConfig> => unit = "registerConfig"
external registerConfig: array<appConfig<'a>> => unit = "registerConfig"

@module("react-native") @scope("AppRegistry")
external registerRunnable: (appKey, appParameters => unit) => string = "registerRunnable"
Expand Down
8 changes: 6 additions & 2 deletionssrc/apis/Style.res
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,8 +22,12 @@ type margin = size
@inline
let auto = "auto"

type offset
@obj external offset: (~height: float, ~width: float) => offset = ""
type offset = {
height: float,
width: float,
}
@deprecated("Directly create record instead") @obj
external offset: (~height: float, ~width: float) => offset = ""

type angle
let deg: float => angle = num => (num->Js.Float.toString ++ "deg")->Obj.magic
Expand Down
8 changes: 6 additions & 2 deletionssrc/apis/Style.resi
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,8 +17,12 @@ type margin = size
@inline("auto")
let auto: margin

type offset
@obj external offset: (~height: float, ~width: float) => offset = ""
type offset = {
height: float,
width: float,
}
@deprecated("Directly create record instead") @obj
external offset: (~height: float, ~width: float) => offset = ""

type angle
let deg: float => angle
Expand Down
5 changes: 3 additions & 2 deletionssrc/components/ScrollView.res
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
include ScrollViewElement

type contentOffset
@obj external contentOffset: (~x: float, ~y: float) => contentOffset = ""
type contentOffset = {x: float, y: float}
@deprecated("Directly create record instead") @obj
external contentOffset: (~x: float, ~y: float) => contentOffset = ""

type contentInsetAdjustmentBehavior = [
| #automatic
Expand Down
27 changes: 14 additions & 13 deletionssrc/types/Accessibility.res
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
type state
type checked<'a> = 'a

@inline
let checked = true

@inline
let unchecked = false

@inline
let mixed = "mixed"
@unboxed
type checked =
| @as(false) False
| @as(true) True
| @as("mixed") Mixed

type actionInfo = {
name: string,
Expand All@@ -17,11 +11,18 @@ type actionInfo = {

type actionEvent = AccessibilityActionEvent.t

@obj
type state = {
disabled?: bool,
selected?: bool,
checked?: checked,
busy?: bool,
expanded?: bool,
}
@deprecated("Directly create record instead") @obj
external state: (
~disabled: bool=?,
~selected: bool=?,
~checked: checked<'a>=?,
~checked: checked=?,
~busy: bool=?,
~expanded: bool=?,
unit,
Expand Down
27 changes: 14 additions & 13 deletionssrc/types/Accessibility.resi
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
type state
type checked<'a>

@inline(true)
let checked: checked<bool>

@inline(false)
let unchecked: checked<bool>

@inline("mixed")
let mixed: checked<string>
@unboxed
type checked =
| @as(false) False
| @as(true) True
| @as("mixed") Mixed

type actionInfo = {
name: string,
Expand All@@ -17,11 +11,18 @@ type actionInfo = {

type actionEvent = AccessibilityActionEvent.t

@obj
type state = {
disabled?: bool,
selected?: bool,
checked?: checked,
busy?: bool,
expanded?: bool,
}
@deprecated("Directly create record instead") @obj
external state: (
~disabled: bool=?,
~selected: bool=?,
~checked: checked<'a>=?,
~checked: checked=?,
~busy: bool=?,
~expanded: bool=?,
unit,
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp