cobrowse-sdk-react-native 2.12.0 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "cobrowse-sdk-react-native",
3
- "version": "2.12.0",
3
+ "version": "2.14.0",
4
4
  "description": "Cobrowse SDK for React Native",
5
5
  "main": "js/index.js",
6
6
  "types": "ts/index.d.ts",
7
7
  "scripts": {
8
- "lint-fix": "ts-standard ts/*.d.ts --fix",
8
+ "lint": "ts-standard ts/*.d.ts",
9
+ "lint:fix": "ts-standard ts/*.d.ts --fix",
9
10
  "start:dev": "nodemon --exec ./scripts/copy.sh"
10
11
  },
11
12
  "author": {
@@ -27,17 +28,17 @@
27
28
  ],
28
29
  "license": "Apache-2.0",
29
30
  "optionalDependencies": {
30
- "@types/react": "^18.0.18",
31
- "@types/react-native": "^0.69.6"
31
+ "@types/react": "^18.0.24",
32
+ "@types/react-native": "^0.70.6"
32
33
  },
33
34
  "dependencies": {
34
35
  "lodash": "^4.17.21"
35
36
  },
36
37
  "devDependencies": {
37
- "@types/react": "^18.0.18",
38
- "@types/react-native": "^0.69.6",
39
- "nodemon": "^2.0.19",
40
- "ts-standard": "^11.0.0",
41
- "typescript": "^4.8.2"
38
+ "@types/react": "^18.0.24",
39
+ "@types/react-native": "^0.70.6",
40
+ "nodemon": "^2.0.20",
41
+ "ts-standard": "^12.0.1",
42
+ "typescript": "^4.8.4"
42
43
  }
43
44
  }
@@ -0,0 +1,8 @@
1
+ import type { ReactElement } from 'react'
2
+ import type { ViewProps } from 'react-native'
3
+
4
+ type Props = Readonly<{
5
+ buttonColor?: string
6
+ }> & ViewProps
7
+
8
+ export default function (props: Props): ReactElement | null
package/ts/Redacted.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import type { ReactNode, ReactElement } from 'react'
2
2
 
3
3
  type Props = Readonly<{}> &
4
- Readonly<{
5
- children?: ReactNode | undefined
6
- }>
4
+ Readonly<{
5
+ children?: ReactNode | undefined
6
+ }>
7
7
 
8
8
  export default function (props: Props): ReactElement | null
package/ts/Session.d.ts CHANGED
@@ -7,6 +7,8 @@ export type SessionState = 'active' | 'authorizing' | 'ended' | 'pending'
7
7
 
8
8
  export type RemoteControlState = 'on' | 'requested' | 'rejected' | 'off'
9
9
 
10
+ export type FullDeviceState = 'on' | 'requested' | 'rejected' | 'off'
11
+
10
12
  export interface Agent {
11
13
  id: string
12
14
  name: string
@@ -50,7 +52,7 @@ export default class Session {
50
52
 
51
53
  isEnded (): boolean
52
54
 
53
- setFullDevice (state: boolean): Promise<void>
55
+ setFullDevice (state: boolean | FullDeviceState): Promise<void>
54
56
 
55
57
  setRemoteControl (state: RemoteControlState): Promise<void>
56
58
  }
@@ -3,12 +3,12 @@ import { View, ScrollView, Text, Image, FlatList, SectionList } from 'react-nati
3
3
 
4
4
  export function useUnredaction<
5
5
  T = View | ScrollView | Text | Image | FlatList | SectionList
6
- >(shouldWarnUnhandledRefs?: boolean , componentName?: string): (elem: T) => void
6
+ > (shouldWarnUnhandledRefs?: boolean, componentName?: string): (elem: T) => void
7
7
 
8
8
  type ForwardedRefType<T, P> = typeof React.forwardRef
9
9
 
10
10
  // HOC for adding unredaction to a whole component class
11
- export function unredact(Component: ReactElement): ForwardedRefType<View, Record<string, unknown>>
11
+ export function unredact (Component: ReactElement): ForwardedRefType<View, Record<string, unknown>>
12
12
 
13
13
  // also expose a basic Component based on a View
14
14
  declare const Unredacted: ForwardRefRenderFunction<View, Record<string, unknown>>
package/ts/index.d.ts CHANGED
@@ -4,3 +4,4 @@ export { default as Redacted } from './Redacted'
4
4
  export { default as SessionControl } from './SessionControl'
5
5
  export { default as Unredacted, unredact, useUnredaction } from './Unredacted'
6
6
  export { default as CobrowseAccessibilityService } from './CobrowseAccessibilityService'
7
+ export { useSession } from './useSession'
@@ -0,0 +1,3 @@
1
+ import Session from './Session'
2
+
3
+ export function useSession (): Session | null