-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add TS Support: * Created declaration files * Finished declarations for Config.js * Completed the TS types for the DocumentView component * Updates to the typings of DocumentView.js * Use literals in config, add options file * Add DocumentView methods * Add DocumentView methods * Updated typings for Config.js * Add DocumentView methods * Completed the typings for RNPdftron * Refactor options * Updated: * Typings of the DocumentView props * API docs of onDocumentLoaded and onDocumentError * Use literals in method params * PDFViewCtrl TS support * Fixed typings for PDFViewCtrl * Changes to index.d.ts and document_view.d.ts * Added export for PDFViewCtrl in index.d.ts * Fixed config.options.d.ts exports in index.d.ts * Added exports for the remainig interfaces within document_view.d.ts * Fixed error in document_view.d.ts * Refactor exports and fix a type * specify object interface for onBehaviorActivated * Fixed onDocumentLoaded and onDocumentError typing * move types to own folder * Edit filepaths * Edit mode prop types * Edit onToolChanged types * Updated package.json files * Added missing import in AnnotOptions.d.ts * edit reflowOrientation type * edit defaultEraserType type * Use promises for method return types * make initialLoad optional * Updated interfaces * Rect to include width and height optional properties * Annotation to include pageRect and screenRect optional properties * make CropBox from Rect * Updated definition of CropBox * Add types from latest master updates * Use Record utility * Remove redundant null * Add save copy option buttons * Redefined CustomToolbarKey in ConfigOptions.d.ts * Added pageRect and screenRect to stickyNoteData * fix typo * Use parameter destructuring * migrate js files to ts, tsx * move d.ts files move d.ts files * Revert "move d.ts files" This reverts commit 1390bb3. * generate new d.ts, .js files * add tsconfig to get correct output structure * Added a build script and updated the exports * Fixed build script * Restructed repo * fix typo * Updated PropTypes in DocumentView.tsx * Rename ConfigOptions to Config * Created custom PropTypes * Refactor event function params * Script for Build Process * Updating Build Process Script * document funcProp * Created functions to make propTypes easier to read * funcProp to func * arrayOfProp to arrayOf * oneOfProp to oneOf * use Validator<T>, add JSDocs for functions * Edit comments, rename param val to obj * edit comments * Refactor and add JSDoc * Add JSDoc for propTypes for dev use * Use arrayOf for custom annotationToolbars items * Use template literal for validator Error string * make oneOf, arrayOf accept multiple objects * make oneOf, arrayOf accept multiple values * simplify oneOf, arrayOf * refactor, edit comments * Simplify arrayOf * Add pull_request to build event triggers * Revert "Add pull_request to build event triggers" This reverts commit 210bc33. * Add JSDoc examples * Edit JSDocs * Return null at end of validator function * also specify onChange event type * remove onChange from propTypes & clean comments * Refactor methods to use one Promise * enable allowSyntheticDefaultImports * minor edit to ts-ignore description * use strict mode * Make type-related dependencies any-ver devDependencies * Updated Field interfaces due to changes to master * Replaced an object type with its primitive version * Create npmignore file excl. lib folder * Add extra ts-ignore to onChange * Updated README and API docs in prep for TS release * Edit TypeScript docs * update Installation and Usage with TypeScript * move TS section of readme * Update TS support version in README, edit CONTRIBUTING * Remove extraneous args from PDFViewCtrl requireNativeComponent * Remove unused object * Updated PDFViewCtrl to match DocumentView * Made document a required prop in PDFViewCtrl * (test) Add a prestart script (#372) * Add prestart script to generate JS files * Change branch where we want builds to be * Added/edited minor details/wording * Add preandroid and preios scripts to generate lib * Removed rect from the Annotation interface * Removed PointWithPage interface * Edit build process comments * add periods to end of comments * clarify example branches * remove extra rect from StickyNoteData interface * avoid emitting JS files if there is type error * Added some comments to Config and PDFViewCtrl * Rename Pdftron interface to RNPdftron * Show 2 variants for constructor in Usage example * Explicitly mention PDFTron React Native dependency in README * Avoid "our", "we" * replace "Migrating to TypeScript" with small sentence in "All Users" * Updated API section on TypeScript * Add return type info for getSavedSignatureJpgFolder * (iOS) Remove old podspec nightly mentions (#379) * Remove podspec nightly mentions, no longer necessary * bump ver * iOS enable user bookmarks list editing by default (#380) * Set userBookmarksListEditingEnabled to true by default * bump version * change wording Co-authored-by: JamesTron <[email protected]> * change wording Co-authored-by: JamesTron <[email protected]> * change wording of TS version recommendation Co-authored-by: JamesTron <[email protected]> * change wording of PR step Co-authored-by: JamesTron <[email protected]> * link to wiki * Updated version to 2.0.3-beta.184 (#381) Updated Android version to snapshot 9.1.1-beta02 Updated version to 2.0.3-beta.184 * (iOS) defaultEraserType (#382) * (iOS) defaultEraserType prop * Remove duplicate docs and constants, update original docs * bump ver * Update to Android 9.1.1beta3 (#383) * (Support) (iOS) Quick Navigation Button (#384) * (iOS) showQuickNavigationButton * Updated documentation * Fixed mistake in documentation * Bump version number * Updated default value of prop to true * Updated Android version to 9.1.1-beta05 * Remove package-lock.json and edit build process to install deps first * Edit build process to apply changes from dev to master - Also update to major version Co-authored-by: Dominic Cupidon <[email protected]> Co-authored-by: Jamie Dassoulas <[email protected]> Co-authored-by: JamesTron <[email protected]> Co-authored-by: eamon-mallon <[email protected]> Co-authored-by: sgong-pdftron <[email protected]> Co-authored-by: Dominic Cupidon <[email protected]> Co-authored-by: brandenfung2 <[email protected]>
- Loading branch information
1 parent
28715fb
commit a06bfeb
Showing
23 changed files
with
748 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Transpile TS | ||
|
||
on: | ||
push: | ||
branches: [dev] # <-- Change this to the primary branch (for example, "dev" if you want all changes to `dev` to be watched). | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token. | ||
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo. | ||
|
||
- name: Install dependencies | ||
run: | | ||
npm i | ||
- name: Node setup | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
cache: 'npm' | ||
|
||
- name: Build JavaScript files | ||
run: | # Change last line to your build script command #. | ||
npm run start | ||
- name: Force add JS files to override .gitignore | ||
run: git add --force ./lib # <-- Change this to your build path. | ||
|
||
- name: Commit files | ||
run: | # Change last line to your preferred commit message (I like `chore: build js files`). | ||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git commit -m "Updating JS files" -a | ||
- name: Push changes | ||
uses: ad-m/[email protected] | ||
with: | ||
force: true | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: master # <-- Change this to the branch where you want builds to be (for example, "master" if you want changes to the primary branch to be applied to `master`). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
# OSX | ||
# | ||
.DS_Store | ||
|
||
# node.js | ||
# | ||
node_modules/ | ||
npm-debug.log | ||
yarn-error.log | ||
|
||
|
||
# Xcode | ||
# | ||
build/ | ||
Pods/ | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
!default.mode1v3 | ||
*.mode2v3 | ||
!default.mode2v3 | ||
*.perspectivev3 | ||
!default.perspectivev3 | ||
xcuserdata | ||
*.xccheckout | ||
*.moved-aside | ||
DerivedData | ||
*.hmap | ||
*.ipa | ||
*.xcuserstate | ||
project.xcworkspace | ||
|
||
|
||
# Android/IntelliJ | ||
# | ||
build/ | ||
.idea | ||
.gradle | ||
local.properties | ||
*.iml | ||
|
||
# BUCK | ||
buck-out/ | ||
\.buckd/ | ||
*.keystore | ||
|
||
example/android/app/src/main/assets/index.android.bundle | ||
example/android/app/src/main/assets/index.android.bundle.meta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { NativeModules } from 'react-native'; | ||
import { PDFViewCtrl } from './src/PDFViewCtrl/PDFViewCtrl'; | ||
import { DocumentView } from './src/DocumentView/DocumentView'; | ||
import { Config } from './src/Config/Config'; | ||
import * as AnnotOptions from './src/AnnotOptions/AnnotOptions'; | ||
|
||
interface RNPdftron { | ||
initialize(licenseKey: string) : void; | ||
enableJavaScript(enabled: boolean) : void; | ||
getVersion() : Promise<string>; | ||
getPlatformVersion() : Promise<string>; | ||
getSystemFontList() : Promise<string>; | ||
clearRubberStampCache() : Promise<void>; | ||
encryptDocument(filePath: string, password: string, currentPassword: string) : Promise<void>; | ||
pdfFromOfficeTemplate(docxPath: string, json: object) : Promise<string>; | ||
} | ||
|
||
const RNPdftron : RNPdftron = NativeModules.RNPdftron; | ||
|
||
export { | ||
RNPdftron, | ||
PDFViewCtrl, | ||
DocumentView, | ||
Config, | ||
AnnotOptions, | ||
}; |
Oops, something went wrong.