Skip to content

Commit

Permalink
Merge pull request #5 from berty/fetch-hack
Browse files Browse the repository at this point in the history
feat: fetch hack example
  • Loading branch information
n0izn0iz authored Jan 6, 2022
2 parents 833a18d + f5f4364 commit aec4b76
Show file tree
Hide file tree
Showing 11 changed files with 376 additions and 298 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: JS
on:
push:
tags:
- v*
branches:
- master
pull_request:

build-and-lint:
runs-on: ubuntu-latest
strategy:
matrix:
node:
#- 10.x
#- 12.x
- 14.x
steps:
- uses: actions/checkout@v2.4.0
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v2.5.0
with:
node-version: ${{ matrix.node }}
- name: Install node modules
working-directory: rn
run: yarn
- name: Lint
working-directory: rn
run: yarn lint
12 changes: 6 additions & 6 deletions rn/__tests__/App-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
* @format
*/

import 'react-native';
import React from 'react';
import App from '../src/App';
import 'react-native'
import React from 'react'
import App from '../src/App'

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
import renderer from 'react-test-renderer'

it('renders correctly', () => {
renderer.create(<App />);
});
renderer.create(<App />)
})
73 changes: 37 additions & 36 deletions rn/react-native-gomobile-ipfs/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,55 +1,56 @@
export enum RequestOption {
Bool = 'b',
String = 's',
Bytes = 'd'
Bool = 'b',
String = 's',
Bytes = 'd',
}

export enum RequestBody {
String = 's',
Bytes = 'd'
String = 's',
Bytes = 'd',
}

export class RequestBuilder {
public withArgument(argument: String): Promise<RequestBuilder>;
public withOption(option: String, type: RequestOption.Bool, value: boolean): Promise<RequestBuilder>;
public withOption(option: String, type: RequestOption.Bytes, value: Uint8Array): Promise<RequestBuilder>;
public withOption(option: String, type: RequestOption.String, value: string): Promise<RequestBuilder>;
public withBody(type: RequestBody.String, value: string): Promise<RequestBuilder>;
public withBody(type: RequestBody.Bytes, value: Uint8Array): Promise<RequestBuilder>;
public withHeader(header: string, value: string): Promise<RequestBuilder>;

public send(): Promise<Uint8Array>;
public sendToDict(): Promise<Record<string, any>>;

public free(): Promise<void>;
public withArgument(argument: String): Promise<RequestBuilder>
public withOption(
option: String,
type: RequestOption.Bool,
value: boolean | Uint8Array | string,
): Promise<RequestBuilder>
public withBody(type: RequestBody.String, value: Uint8Array | string): Promise<RequestBuilder>
public withHeader(header: string, value: string): Promise<RequestBuilder>

public send(): Promise<Uint8Array>
public sendToDict(): Promise<Record<string, any>>

public free(): Promise<void>
}

export class IPFS {
public static defaultRepoPath: string;
public static defaultRepoPath: string

public static setDNSPair(primary: string, secondary: string): Promise<void>;
public static setDNSPair(primary: string, secondary: string): Promise<void>

public static create(repoPath?: string, internalStorage?: boolean): Promise<IPFS>;
public static create(repoPath?: string, internalStorage?: boolean): Promise<IPFS>

public start(): Promise<void>;
public serveAPI(onTCPPort: string): Promise<string>;
public serveGateway(onMultiaddr: string): Promise<string>;
public stop(): Promise<void>;
public restart(): Promise<void>;
public start(): Promise<void>
public serveAPI(onTCPPort: string): Promise<string>
public serveGateway(onMultiaddr: string): Promise<string>
public stop(): Promise<void>
public restart(): Promise<void>

public enablePubsubExperiment(): Promise<void>;
public enableNamesysPubsub(): Promise<void>;
public enablePubsubExperiment(): Promise<void>
public enableNamesysPubsub(): Promise<void>

public isStarted(): Promise<boolean>;
public isStarted(): Promise<boolean>

public getConfig(): Promise<Record<string, any>>;
public getConfigKey(key: string): Promise<Record<string, any>>;
public setConfig(config?: Record<string, any>): Promise<void>;
public setConfigKey(key: string, value: Record<string, any>): Promise<void>;
public getConfig(): Promise<Record<string, any>>
public getConfigKey(key: string): Promise<Record<string, any>>
public setConfig(config?: Record<string, any>): Promise<void>
public setConfigKey(key: string, value: Record<string, any>): Promise<void>

public getAbsoluteRepoPath(): Promise<string>;
public getAbsoluteRepoPath(): Promise<string>

public newRequest(command: string): Promise<RequestBuilder>;
public newRequest(command: string): Promise<RequestBuilder>

public free(): Promise<void>;
}
public free(): Promise<void>
}
Loading

0 comments on commit aec4b76

Please sign in to comment.